Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Auto name form and save to network

sparrowce
Level 4
Level 4

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
sparrowce
Level 4
Level 4

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!

chrisb29762052
Level 2
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

radzmar
Level 10
Level 10

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

chrisb29762052
Level 2
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.

radzmar
Level 10
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...