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

JavaScript Button in PDF to attach form in draft email.

New Here ,
Jul 02, 2018 Jul 02, 2018

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
2.1K
Translate
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).

Translate
Community Expert ,
Jul 02, 2018 Jul 02, 2018

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>

Translate
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

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

});

Translate
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

Are there any error messages in the JS Console?

Translate
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

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.

Translate
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

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

});

Translate
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

for some reason it is not reading the getField

Translate
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

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

Translate
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

Sent the file to your email

Translate
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

What did you enter in the fields?

Translate
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

Translate
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
LATEST

The fields are empty...

Translate
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

No

Translate
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