Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Auto name form and save to network

Avatar

Former Community Member

Any way to add custom file name to app.execMenuItem("SaveAs");?  When it saves, it does exactly what I'm needing - open windows explorer so users can drill down to the proper destination, which will be varied.  However, am having trouble finding how to name the file based on 3 pieces of form data. 

Example:

ContractNo_ProjectNo_ChangeNo.pdf

Any assistance appreciated, thank you!

6 Replies

Avatar

Former Community Member

Thank you, it was helpful and very detailed.  I did download and review the files, but unfortunately am not knowledgable enough to implement it, and it mentions saving to specific directories.  I didn't know how to modify to open the windows explorer dialog box with the filename prefilled from 3 form fields instead of specific directory, as it will vary quite a bit. 

Also it seemed to need a file placed in javascript folder.  I won't be able to do that, so this may not be an option for me, after all, and I may just need to leave it at app.execMenuItem("SaveAs");. 

Lots to learn . . .

Thank you!

Avatar

Level 2

I am using ES4 version 11

I read your article and entered the following script statement it in a button :

DSCRReport.Page_1_DSCReport.Button3::click - (JavaScript, client)

var LCB_SaveAs = app.trustedFunction(function(doc)

{

app.beginPriv();

var LCB_SaveAsTarget = SaveAsTarget;

doc.saveAs(LCB_SaveAsTarget);

app.endPriv();

});

Nothing happen when I attempt to activate the process and the console give me the following error message"

NotAllowedError: Security settings prevent access to this property or method.

App.trustedFunction:2:XFA:DSCRReport[0]:Page_1_DSCReport[0]:Button3[0]:click

I understood that this script was the work around to the security restriction. Is there something else that I should be doing. Or has it been made impossible to do.

I was hoping to use your recommended script to automate the format of the file name upon saving.

Thanks

Avatar

Level 10

Di you test this with Acrobat or just in Designer's PDF-Preview?

Avatar

Level 2

I had only tested with the Designer's PDF-Preview . Further to your question I went back and tested with Acrobat XI pro  and Acrobat Pro DC latest version with the same result.

Avatar

Level 10

I were not able to reproduce you problem at my end - the solution works in Designer's PDF-Preview and Acrobat for me.

You may check out my updated version.

LiveCycle Blog: Formulare mit neuem Namen in bestimmtes Verzeichnis speichern//Save forms with new n...