Expand my Community achievements bar.

SOLVED

Saving a form on click of a button.

Avatar

Former Community Member

Hi,

I need the script to save the form on click of button.I've tried to use "app.execMenuItem("Save");".But it is not working.

Is there any equvalent for this command in livecycle forms?

Please Help..

1 Accepted Solution

Avatar

Correct answer by
Level 5

Unfortunately there is no equivalent and the operation you are trying to do is unsafe. From the javascript reference

(Acrobat 8.0) The execution of menu items through execMenuItem method is restricted to a short list of safe menus. The execMenuItem method will silently fail if a named menu item is executed that is not on the safe menu list. Menu items may be removed in future releases, or their behavior may change.

Save is an item on that list. The only way to get it to work is to run it under a privileged context (batch/console/trusted function in js folder)

View solution in original post

1 Reply

Avatar

Correct answer by
Level 5

Unfortunately there is no equivalent and the operation you are trying to do is unsafe. From the javascript reference

(Acrobat 8.0) The execution of menu items through execMenuItem method is restricted to a short list of safe menus. The execMenuItem method will silently fail if a named menu item is executed that is not on the safe menu list. Menu items may be removed in future releases, or their behavior may change.

Save is an item on that list. The only way to get it to work is to run it under a privileged context (batch/console/trusted function in js folder)