Launching Attachments on StartProdEntry

All,

I am finally taking the painstaking process of migrating our customizations from our 10.2.700 classic menus into 2024.2 kinetic menus.

I have some functionality which essentially forces the user to review important quality related information each time they clock on an operation for a high risk part. In our legacy system, this used a long series of BPMs, UD fields, and multiple customizations.

– But I don’t think it has to. I wanted to re-implement this solution using a BAQ / Rest call in app studio that would mimic the functionality seen on Part Entry when you open an attachment. I like the File Transfer Using Service document type transfer mode rather than its alternatives because it does not allow the user direct access to the source file. Instead, it uses a blob:url to copy it into the users browser.

So, I thought it would be pretty simple. Initally I used a BAQ to get the xFileRefNum for the DocTypeID I was looking for, and feed that to the download widget in app studio. Nope, that somehow bypasses the document file transfer mode somehow and allows the user direct access to the file. (and does not open the default file viewer on top of the MES screen :face_exhaling:)

So then I thought OK I went to insights- I attended the rest courses, lets knock this out! I look in the network trace log. I use the App Studio rest widget to send my reference number to Ice.BO.AttachmentSvc & DownloadFileFromDocumentStorage.

Easy! I’m almost done… But it doesn’t work. Even when I receive a 200 A-OK, nothing happens. I know I must be missing something- but with app studio I never know when I am doing something wrong or if the widget is broken. I’ve had a hard time navigating through the toolbox using the incomplete documentation in the user guides.

So now I am back to the drawing board. I am looking into solutions where I could embed javascript into some sort of call. Maybe use URL.createObjectURL() in conjunction with xFileName?

To be clear- this task of mine will be complete when a user clocks in on a job, and is immediately shown an attachment in which any modifications will not affect the original. I am most of the way there- but I can’t get the system to show them a copy of the file. It always shows the original (and not in the browser)