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

need some assistance please to finalise this script?

Community Beginner ,
Jun 11, 2024 Jun 11, 2024

Copy link to clipboard

Copied

I have wititen this script however, I am getting the following Sytax error: missing } after property list 4 at line 5

 

see the script below:

{app.alert("Before sending to PC for review, admins please review the following, -Travel Application Details -Cost Breakdown -Private Travel Plan",3)
var cAlert=app.alert("are we ready to send to PC for review?",3,2)}
this.mailDoc({cTo: this.getField("Email Address"), cCc: "manager@email.com",
cSubject: "Travel Application+this.getField("FullName TravellersRow1").valueAsString+this.getField("City 2").valueAsString+this.getField("Departure Date").valueAsString",
cMsg: Please see the attached for your review and complete the 'Travel Justification'section. Refer to the form with a yellow box labeled ' Send to Admin', click the box and this will auto-generate an email back to the admin. admin will then process the rest of your application and progress to the Manager and Assistant Executive Director for review, sign-off, and approval."});}

TOPICS
Create PDFs , JavaScript , Modern Acrobat , PDF , PDF forms

Views

275

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 3 Correct answers

Community Expert , Jun 11, 2024 Jun 11, 2024

There are several syntax errors, I have also added new line for first alert for easier review and condition to second alert to send mail only if answer to alert is "Yes" (let me know if that works for you):

app.alert("Before sending to PC for review, admins please review the following:\n- Travel Application Details\n- Cost Breakdown\n- Private Travel Plan", 3);

var cAlert = app.alert("Are we ready to send to PC for review?", 3, 2);

if (cAlert == 4) {
 this.mailDoc({
  cTo: this.getField("Email
...

Votes

Translate

Translate
Community Beginner , Jun 12, 2024 Jun 12, 2024

Afternoon, 

I use 

cTo: this.getField("Email Address").valueAsString,

Votes

Translate

Translate
Community Expert , Jun 12, 2024 Jun 12, 2024

This should work.

Votes

Translate

Translate
Community Expert ,
Jun 11, 2024 Jun 11, 2024

Copy link to clipboard

Copied

There are several syntax errors, I have also added new line for first alert for easier review and condition to second alert to send mail only if answer to alert is "Yes" (let me know if that works for you):

app.alert("Before sending to PC for review, admins please review the following:\n- Travel Application Details\n- Cost Breakdown\n- Private Travel Plan", 3);

var cAlert = app.alert("Are we ready to send to PC for review?", 3, 2);

if (cAlert == 4) {
 this.mailDoc({
  cTo: this.getField("Email Address").valueAsString,
  cCc: "manager@email.com",
  cSubject: "Travel Application " + this.getField("FullName TravellersRow1").valueAsString + " " + this.getField("City 2").valueAsString + " " + this.getField("Departure Date").valueAsString,
  cMsg: "Please see the attached for your review and complete the 'Travel Justification' section. Refer to the form with a yellow box labeled 'Send to Admin', click the box and this will auto-generate an email back to the admin. Admin will then process the rest of your application and progress to the Manager and Assistant Executive Director for review, sign-off, and approval."});}

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 Beginner ,
Jun 11, 2024 Jun 11, 2024

Copy link to clipboard

Copied

Thank you Nesa, appreciate this. will update my script and will respond back shortly.

 

Malo

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 Beginner ,
Jun 12, 2024 Jun 12, 2024

Copy link to clipboard

Copied

Hello Nesa, thank you so much! this worked wonders!.

 

I have one question, I have highlighted this in yellow for you, in the form I have created a text field so the users can enter their email addresses into them. however this does populate the email address I tested (see the other attachment for the error) and actually stops the email from being generated the minute I removed this field it and made it" ", it works fine, however the 'To' Field is just blank and the 'Cc' field works., is it becuase I need to format this field to generate email?

Manumalo343929158btb_0-1718176001682.png

Manumalo343929158btb_1-1718176314514.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
Community Expert ,
Jun 12, 2024 Jun 12, 2024

Copy link to clipboard

Copied

Do you use:
cTo: this.getField("Email Address").valueAsString,
or:
cTo: this.getField("Email Address"),

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 Beginner ,
Jun 12, 2024 Jun 12, 2024

Copy link to clipboard

Copied

Afternoon, 

I use 

cTo: this.getField("Email Address").valueAsString,

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 ,
Jun 12, 2024 Jun 12, 2024

Copy link to clipboard

Copied

This should work.

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 Beginner ,
Jun 12, 2024 Jun 12, 2024

Copy link to clipboard

Copied

the Emaill Address field I have used in the form is a text field is that the correct field to use to enter email addresses into or does the test field need to be formatted using 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
Community Beginner ,
Jun 12, 2024 Jun 12, 2024

Copy link to clipboard

Copied

LATEST

Thank you Nesa and Bernd, both your assistance has helped, I went back and review my script and decided to save and exit. upon doing so it somehow refreshed what I have inputted in there and has since worked. I will now continue and complete this form. again your help has been much appreciated.

 

Malo

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