JavaScript Button in PDF to attach form in draft email.

New Here ,
Jul 02, 2018

Copy link to clipboard

Copied

I have the following code but it is not creating a draft when you click on it. What is wrong?

var subject= getField("Part Number").value + (" \ ") + getField("Material Number").value + getField("Priority").value

this.mailDoc({

cTo: "email1@email.com",

cCC: "Email@email.com",

cSubject: subject,

cMsg: "This is a DORF Request please provide a response in a timely fashion."

});

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

I'll need to see the file itself to be able to help you further.

You can share it via Dropbox, Google Drive, etc., or if you want you can send it to me via email (try6767 at gmail.com).

TOPICS
Acrobat SDK and JavaScript, Windows

Views

204

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

JavaScript Button in PDF to attach form in draft email.

New Here ,
Jul 02, 2018

Copy link to clipboard

Copied

I have the following code but it is not creating a draft when you click on it. What is wrong?

var subject= getField("Part Number").value + (" \ ") + getField("Material Number").value + getField("Priority").value

this.mailDoc({

cTo: "email1@email.com",

cCC: "Email@email.com",

cSubject: subject,

cMsg: "This is a DORF Request please provide a response in a timely fashion."

});

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

I'll need to see the file itself to be able to help you further.

You can share it via Dropbox, Google Drive, etc., or if you want you can send it to me via email (try6767 at gmail.com).

TOPICS
Acrobat SDK and JavaScript, Windows

Views

205

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
Jul 02, 2018 0
Most Valuable Participant ,
Jul 02, 2018

Copy link to clipboard

Copied

Change the name of the "subject" variable to something else, like

"mySubject". "subject" is one of the document's built-in properties, so you

might be accidentally trying to write to it.

On 2 July 2018 at 17:00, borin southernr24415334 <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...
Jul 02, 2018 0
New Here ,
Jul 02, 2018

Copy link to clipboard

Copied

This is what it looks like but It is now leaving subject line blank.

var Mysubject= getField("Part Number").value + (" \ ") + getField("Material Number").value + getField("Priority").value

this.mailDoc({

cTo: "email1@email.com",

cCC: "Email@email.com",

cSubject: Mysubject,

cMsg: "This is a DORF Request please provide a response in a timely fashion."

});

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...
Jul 02, 2018 0
Most Valuable Participant ,
Jul 02, 2018

Copy link to clipboard

Copied

Are there any error messages in the JS Console?

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...
Jul 02, 2018 0
Most Valuable Participant ,
Jul 02, 2018

Copy link to clipboard

Copied

If you want to include a back-slash in the text you need to escape it. So change this:

(" \ ")

To:

"\\"

There's no need to use parentheses.

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...
Jul 02, 2018 0
New Here ,
Jul 02, 2018

Copy link to clipboard

Copied

No

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...
Jul 02, 2018 0
New Here ,
Jul 02, 2018

Copy link to clipboard

Copied

Now the subject is only showing (in the Draft):  \\

Script look like this:

var Mysubject= getField("Priority").value + "\\" + getField("Material Number").value + "\\" + getField("Part Number").value

this.mailDoc({

cTo: "email1@email.com",

cCC: "Email@email.com",

cSubject: Mysubject,

cMsg: "This is a DORF Request please provide a response in a timely fashion."

});

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...
Jul 02, 2018 0
New Here ,
Jul 02, 2018

Copy link to clipboard

Copied

for some reason it is not reading the getField

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...
Jul 02, 2018 0
Most Valuable Participant ,
Jul 02, 2018

Copy link to clipboard

Copied

I'll need to see the file itself to be able to help you further.

You can share it via Dropbox, Google Drive, etc., or if you want you can send it to me via email (try6767 at gmail.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...
Jul 02, 2018 0
New Here ,
Jul 02, 2018

Copy link to clipboard

Copied

Sent the file to your 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...
Jul 02, 2018 0
Adobe Community Professional ,
Jul 02, 2018

Copy link to clipboard

Copied

What did you enter in the 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...
Jul 02, 2018 0
New Here ,
Jul 02, 2018

Copy link to clipboard

Copied

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...
Jul 02, 2018 0
try67 LATEST
Most Valuable Participant ,
Jul 02, 2018

Copy link to clipboard

Copied

The fields are empty...

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...
Jul 02, 2018 0