• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

JavaScript Button in PDF to attach form in draft email.

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

});

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.0K

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
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 02, 2018 Jul 02, 2018

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

Votes

Translate

Translate
Community Expert ,
Jul 02, 2018 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>

Votes

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
community guidelines
New Here ,
Jul 02, 2018 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."

});

Votes

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
community guidelines
Community Expert ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

Are there any error messages in the JS Console?

Votes

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
community guidelines
Community Expert ,
Jul 02, 2018 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.

Votes

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
community guidelines
New Here ,
Jul 02, 2018 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."

});

Votes

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
community guidelines
New Here ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

for some reason it is not reading the getField

Votes

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
community guidelines
Community Expert ,
Jul 02, 2018 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).

Votes

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
community guidelines
New Here ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

Sent the file to your email

Votes

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
community guidelines
Community Expert ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

What did you enter in the fields?

Votes

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
community guidelines
New Here ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

Votes

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
community guidelines
Community Expert ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

LATEST

The fields are empty...

Votes

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
community guidelines
New Here ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

No

Votes

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
community guidelines