acrobat signature preventing app.mailMsg() from executing

New Here ,
Oct 17, 2017

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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript

Views

218

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

acrobat signature preventing app.mailMsg() from executing

New Here ,
Oct 17, 2017

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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript

Views

219

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 17, 2017 0
Most Valuable Participant ,
Oct 17, 2017

Copy link to clipboard

Copied

Can you post your code?

On Tue, Oct 17, 2017 at 8:46 PM, scottp51589877 <forums_noreply@adobe.com>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 17, 2017 0
Adobe Community Professional ,
Oct 17, 2017

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 17, 2017 0
Most Valuable Participant ,
Oct 17, 2017

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 17, 2017 0
New Here ,
Oct 17, 2017

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...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 17, 2017 0
Most Valuable Participant ,
Oct 17, 2017

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 17, 2017 0
Adobe Community Professional ,
Oct 17, 2017

Copy link to clipboard

Copied

I’d never have caught that.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 17, 2017 0