Dynamic Subject line won't allow submit button to work.

New Here ,
Aug 22, 2018

Copy link to clipboard

Copied

This is my script...I can't figure out what I'm missing.  When I click submit it doesn't do anything.  I'm trying to create a dynamic subject line with text in the body to click submit and the form to email as an attachment.

var CID = getField("CID").valueAsString;

var ORG = getField("ORG").valueAsString;

var ClientName = getField("ClientName").valueAsString;

var Requestor = getField("Requestor").valueAsString;

this.mailDoc({CTo:"email@email.com", cSubject: "Billing Adjustment for: CID "+CID+" - Org "+ORG+" - "+ClientName+" - "+Requestor, cMsg: "Please see the attached adjustment for "+ClientName+"."});

Any help is greatly appreciated.

Adobe Community Professional
Correct answer by George_Johnson | Adobe Community Professional

Make sure that the field name you're using in the code matches the actual field name exactly. That error is saying that a field with that name does not exist.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

78

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

Dynamic Subject line won't allow submit button to work.

New Here ,
Aug 22, 2018

Copy link to clipboard

Copied

This is my script...I can't figure out what I'm missing.  When I click submit it doesn't do anything.  I'm trying to create a dynamic subject line with text in the body to click submit and the form to email as an attachment.

var CID = getField("CID").valueAsString;

var ORG = getField("ORG").valueAsString;

var ClientName = getField("ClientName").valueAsString;

var Requestor = getField("Requestor").valueAsString;

this.mailDoc({CTo:"email@email.com", cSubject: "Billing Adjustment for: CID "+CID+" - Org "+ORG+" - "+ClientName+" - "+Requestor, cMsg: "Please see the attached adjustment for "+ClientName+"."});

Any help is greatly appreciated.

Adobe Community Professional
Correct answer by George_Johnson | Adobe Community Professional

Make sure that the field name you're using in the code matches the actual field name exactly. That error is saying that a field with that name does not exist.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

79

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
Aug 22, 2018 0
Most Valuable Participant ,
Aug 22, 2018

Copy link to clipboard

Copied

Press Ctrl+J and check if there are any error messages after you click the button.

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...
Aug 22, 2018 0
New Here ,
Aug 22, 2018

Copy link to clipboard

Copied

It's tell me my ClientName field is null, however you can see I have text in the field

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...
Aug 22, 2018 0
Adobe Community Professional ,
Aug 22, 2018

Copy link to clipboard

Copied

Make sure that the field name you're using in the code matches the actual field name exactly. That error is saying that a field with that name does not exist.

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...
Aug 22, 2018 0
New Here ,
Aug 22, 2018

Copy link to clipboard

Copied

awesome thank you!!  They looked the same, but I retyped them and then they worked.  I appreciate it.  Now to figure out how to get it to not bypass my required fields.

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...
Aug 22, 2018 0
Adobe Community Professional ,
Aug 22, 2018

Copy link to clipboard

Copied

Change CTo to cTo.

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...
Aug 22, 2018 0
New Here ,
Aug 22, 2018

Copy link to clipboard

Copied

corrected that, thanks still doesn't work.

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...
Aug 22, 2018 0