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

Custom Subject line in Java Script

New Here ,
Apr 30, 2020 Apr 30, 2020

I built a button on a form to email the entire .pdf back for review. I figured out how to program the button to execute a Java script that will pull data from a field and display it in the Subject line of the email.

var mySubject=this.getField("Traveler Name").value;

this.mailDoc({bUI: true, cTo: "corporate.security@mycompany.com", cSubject: mySubject})

What I can't seem to figure out is how to edit the script to include the text, "Business Essential Travel Request from: " to precede the [Traveler Name] field in the Subject line:

 

PS: I have NO Java KSA's.

TOPICS
Acrobat SDK and JavaScript
1.0K
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 , Apr 30, 2020 Apr 30, 2020

In JavaScript, Text is concatonated just like numbers are added.

 

var mySubject= "Business Essential Travel Request from: " + this.getField("Traveler Name").value;

Translate
Community Expert ,
Apr 30, 2020 Apr 30, 2020

In JavaScript, Text is concatonated just like numbers are added.

 

var mySubject= "Business Essential Travel Request from: " + this.getField("Traveler Name").value;

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Apr 30, 2020 Apr 30, 2020

var cSubLine = "Business Essential Travel Request for " + this.getField("Traveler Name") .value;
this.mailDoc({bUI: true, cTo: "corporate.security@mycompany.com", cSubject: cSubLine})

 

thoughts?

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 ,
Apr 30, 2020 Apr 30, 2020

Do you have a question?

The code looks good.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
May 01, 2020 May 01, 2020
LATEST

No, sorry! No question- just wanted confirmation the code was sound.  Thanks for your time!

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