Copy link to clipboard
Copied
I have a PDF form that has a submit button that sends a notification email using the javascript app.mailMsg() function. I need to use app.mailMsg() as the form is auto-saved to a company server as it's filled out and I just need to send a notification email using one of the form variables (the doc. number). I do not need to send the form.
The form also uses a digital signature field to track who in the company is submitting forms. My problem is, if someone signs the document, the app.mailMsg() call ceases to work and generates the following error:
NotAllowedError: Security settings prevent access to this property or method. Doc.subject:2:Field SUBMIT:Mouse Up
I've managed to track the problem to the digital signature. At any point, before signing the document, if the submit button is clicked, it generates the appropriate email. Once the document is signed, security measures prevent the submit button from working. Is there a way to fix/workaround this issue?
My guess is they've created a variable called "subject", which is conflicting with the internal property of the Document object with that name, so moving the code won't solve it. Renaming the variable to something else will.
Copy link to clipboard
Copied
Can you post your code?
On Tue, Oct 17, 2017 at 8:46 PM, scottp51589877 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
You can move your code from the submit button to the Signature field so that it executes when the document gets signed.
Copy link to clipboard
Copied
My guess is they've created a variable called "subject", which is conflicting with the internal property of the Document object with that name, so moving the code won't solve it. Renaming the variable to something else will.
Copy link to clipboard
Copied
thanks try67! renamed the subject variable and it's working great!
Too bad I just found out the method isn't supported in reader which is what 90% of our employees will use...
Copy link to clipboard
Copied
Yes, that's correct. That's why it's important to carefully read the documentation of the methods and properties you use in your code, to make sure they will work in all circumstances the file is going to be used.
You can change it to mailDoc, though. It offers the same functionality, only then the file itself will be attached to the email.
Copy link to clipboard
Copied
I’d never have caught that.