Hello All,
I'm trying to use the addMenuItem method in the "docReady" event on my dynamic, LCD form. According to the LiveCycle Designer Scripting Basics manual, the addMenuItem is a support method.
However, upon further research, I've discovered that the addMenuItem method can only be used in a privileged context, which explains the "NotAllowedError: Security settings prevent access to this property or method." message I get when I try to use addMenuItem.
Fortunately, Acrobat apparently has another method called "trustedFunction" that allows a function to be executed in a non-privileged context.
However, even when I use the trustedFunction method on the "docReady" event of my LCD form, I still get the following error on the Javascript debugger:
"NotAllowedError: Security settings prevent access to this property or method. App.trustedFunction:3:XFA:form1[0]:CoverSheet[0]:Button1[0]:docReady"
Doesn't this kind of defeat the purpose of the trustedFunction method if the trustedFunction method must also be executed in a privileged context?
Here is my full test code I've placed in the docReady event:
var trustedMenuItem = app.trustedFunction(
function()
{
app.beginPriv(); // Explicitly raise the privilege
app.addMenuItem({cName:"Menu Test",
cParent: "Help",
cExec: "app.alert('Menu Item Test'); "});
app.endPriv(); // privileged and/or non-privileged code here
}
);
trustedMenuItem;
Is there anything else I can do, or is the trustedMenuItem method really not supported in LiveCycle Designer Forms for dynamic forms?
Thanks for any help!
David