Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Issue saving PDF opened via an Outlook email link

Avatar

Former Community Member

We have a  LiveCycle  XFA form that contains a "silent save" trusted function using doc.saveAs(). 

Users complete the form, save it, and e-mail it as an attachment with the JavaScript submitForm() function. One of the people who processes the form opens the e-mail, assigns specific processing duties to other people in the chain, and closes/saves the PDF file to a folder on our network. These other processors can open the document, carry out their assignments, click check boxes to indicate progress, and save the file back to the network location. The document uses app.mailMsg() to send a status report to everyone working the project.

No problem with this system, works fine - but I'd like to address one inconvenience by including a link to the file's location in the status e-mails. The idea is to click the link to open the file. I've successfully written script to accomplsh that. The problem is that the "silent save (doc.SaveAs) fails when the file is opened via the Outlook link. I get the "file may be read-Only" error message: "The file may be read-only, or another user may have it open. Please save the document with a different name or in a different folder."

I assume there is a step I'm overlooking somewhere, but I just can't figure out what. Does anyone have any suggestions?

- fred

2 Replies

Avatar

Level 10

It's because the form opens as temporary file I believe.

Your saveAs script then propably has no access to the network drive.

Avatar

Former Community Member

Thanks radzmar. Great suggestion to explore. I saved the original path/filename in text fields, saved the form, and emailed the link, closed the file. Immediately after opening the file from the link, I tried the saveAs() routine to save it to the path/filename stored in the form. Same error result - "may be read-Only ...."

Next I tried saving the opened-by-link file with a different "temp" name. SaveAs() worked ... saving the file without the error. Then I saved it using the original path/file name saved in the document. That also worked without the error.  I guess the opened-by-link file has to be "disassociated" with Acrobat to avoid the read-Only error.

Now I just have to determine the easiest way to delete the temp file from the network.