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

New to Javascript - Cannot get form to open/email via outlook

New Here ,
Dec 17, 2024 Dec 17, 2024

Copy link to clipboard

Copied

Hi all,  

 

I have combed a ton of articles on this subject and I am hitting walls with every attempt.  I have a simple fillable form I built and want to submit the entire PDF to an email with custom subject line and reflect the attached document name.  (Just using the submit form option send a renamed pdf to the email just fine but a generic subject line.)

I am using the following javascript and have tried a few other examples.  Nothing comes up in the console with errors but outlook does not open to send the email.  If I open in a browser I get a popup that asks if I want to send to the email in question but it opens a new tab in chrome what does nothing. If I open in MS Edge it tabs back to chrome but does not open a tab... WHere am I going wrong?

Any help is appreciated!  I have a few forms I am updating to be useful like this so I am motivated to learn this!

var cToAddr = "me@email.com";
var cSubLine = "Facilities Work Request"+" "+this.getField("Location").valueAsString;

this.mailDoc
({bUI: true,
cTo: cToAddr,
cSubject: cSubLine})


File I am working with attached.
 

TOPICS
Create PDFs , JavaScript , PDF , PDF forms

Views

123

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 ,
Dec 17, 2024 Dec 17, 2024

Copy link to clipboard

Copied

It works for me.  Do you have this setting:

 

PDFAutomationStation_0-1734468499398.png

 

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 ,
Dec 17, 2024 Dec 17, 2024

Copy link to clipboard

Copied

Thanks for confirming.  I came back from lunch and it's working!  I must have incorrectly saved or something on the previous attempts.  I was able to add the things I needed and it's working as intended now.  

Is there a reason why using this from a browser does not work?  Chrome still opens a blank tab and edge opens chrome but does not open a tab... Not a deal breaker but it would be nice if this worked via app AND browser...

var cToAddr = "mail@server.com";
var cSubLine = "Facilities Work Request"+" - "+this.getField("Location").valueAsString;
var cBody = "Work Order attached for"+" - "+this.getField("Location").valueAsString+" From "+this.getField("Submitted By:").valueAsString+"\n"+"Description of issue: "+this.getField("Description").valueAsString;

this.mailDoc
({bUI: true,
cTo: cToAddr,
cSubject: cSubLine,
cMsg: cBody})

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 ,
Dec 17, 2024 Dec 17, 2024

Copy link to clipboard

Copied

LATEST

Non-Adobe pdf viewers are hit and miss with the scripts they support.  Most likely a miss with this script.

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