Hi,
I have a pretty long piece of javascript that I'm trying to write to get an acrobat form to launch the body of an email. There may be a few places that I've made errors, but can't find them for the life of me. I've used a similar version of this script and everything ran beautifully that time...
I'm still pretty green at all this, so would love any and all help.
Here's my current script:
var to = this.getField("To");
var membershipstatusv = this.getField("Membership Status");
var grmembernumberv = this.getField("GR Member Number");
var numberofpeopleimpactedv = this.getField("Number of people impacted");
var namesofmembersv = this.getField("Names of members");
var countryv = this.getField("Country");
var cityv = this.getField("City");
var latitudev = this.getField("Latitude");
var longitudev = this.getField("Longitude");
var incidenttypev = this.getField("Incident Type");
var descriptionofissuev = this.getField("Description of Issue");
var Actionstakentodatev = this.getField("Actions Taken To Date");
var timev = this.getField("Time");
var opspersonreportingv = this.getField("Ops person reporting");
var subject = "New Incident Notification"
var emailBody = "";
emailBody += "NEW INCIDENT\r\n";
emailBody += "COMM WATCHSTANDER: " + opspersonreportingv.value + "\r\n";
emailBody += "\r\n";
emailBody += "MEMBERSHIP STATUS";
emailBody += membershipstatusv.value + "\r\n";
emailBody += corporateclientnamev.value + "\r\n";
emailBody += othermembershiptypev.value + "\r\n";
emailBody += “GR MEMBER NUMBER:” + grmembernumberv.value + "\r\n";
emailBody += “NUMBER OF PEOPLE IMPACTED:" + numberofpeopleimpactedv.value + "\r\n";
emailBody += “NAMES OF MEMBERS” namesofmembersv.value + "\r\n";
emailBody += "\r\n";
emailBody += "LOCATION OF INCIDENT";
emailBody += countryv.value + "\r\n";
emailBody += cityv.value + "\r\n";
emailBody += “LAT” + latitudev.value + “ LONG” + longitudev.value + "\r\n";
emailBody += "\r\n";
emailBody += "INCIDENT TYPE";
emailBody += incidenttypev.value + "\r\n";
emailBody += "\r\n";
emailBody += "DESCRIPTION OF ISSUE";
emailBody += descriptionofissuev.value + "\r\n";
emailBody += "\r\n";
emailBody += "ACTIONS TAKEN TO DATE";
emailBody += actionstakentodatev.value + "\r\n";
emailBody += "\r\n";
emailBody += "TIME:" + timev.value + "\r\n";
emailBody += "\r\n";
emailBody += "SITREPs";
emailBody += SITREPSv.value + "\r\n";
app.mailMsg({
bUI: true,
cTo: to.value,
cSubject: subject,
cMsg: emailBody
} );
var to = this.getField("To");
var membershipstatusretv = this.getField("Membership Status RET");
var membershipstatusffsv = this.getField("Membership Status FFS");
var membershipstatuscorpv = this.getField("Membership Status CORP");
var membershipstatusotherv = this.getField("Membership Status OTHER");
var corporateclientnamev = this.getField("Corporate Client Name");
var othermembershiptypev = this.getField("Other Membership Type");
var grmembernumberv = this.getField("GR Member Number");
var numberofpeopleimpactedv = this.getField("Number of people impacted");
var namesofmembersv = this.getField("Names of members");
var countryv = this.getField("Country");
var cityv = this.getField("City");
var latitudev = this.getField("Latitude");
var longitudev = this.getField("Longitude");
var incidenttypev = this.getField("Incident Type");
var descriptionofissuev = this.getField("Description of Issue");
var Actionstakentodatev = this.getField("Actions Taken To Date");
var timev = this.getField("Time");
var opspersonreportingv = this.getField("Ops person reporting");
var subject = "New Incident Notification"
var emailBody = "";
emailBody += "NEW INCIDENT\r\n";
emailBody += "COMM WATCHSTANDER: " + opspersonreportingv.value + "\r\n";
emailBody += "\r\n";
emailBody += "MEMBERSHIP STATUS";
emailBody += membershipstatusretv.value + "\r\n";
emailBody += membershipstatusffsv.value + "\r\n";
emailBody += membershipstatuscorpv.value + "\r\n";
emailBody += membershipstatusotherv.value + "\r\n";
emailBody += corporateclientnamev.value + "\r\n";
emailBody += othermembershiptypev.value + "\r\n";
emailBody += “GR MEMBER NUMBER:” + grmembernumberv.value + "\r\n";
emailBody += “NUMBER OF PEOPLE IMPACTED:" + numberofpeopleimpactedv.value + "\r\n";
emailBody += “NAMES OF MEMBERS” namesofmembersv.value + "\r\n";
emailBody += "\r\n";
emailBody += "LOCATION OF INCIDENT";
emailBody += countryv.value + "\r\n";
emailBody += cityv.value + "\r\n";
emailBody += “LAT” + latitudev.value + “ LONG” + longitudev.value + "\r\n";
emailBody += "\r\n";
emailBody += "INCIDENT TYPE";
emailBody += incidenttypev.value + "\r\n";
emailBody += "\r\n";
emailBody += "DESCRIPTION OF ISSUE";
emailBody += descriptionofissuev.value + "\r\n";
emailBody += "\r\n";
emailBody += "ACTIONS TAKEN TO DATE";
emailBody += actionstakentodatev.value + "\r\n";
emailBody += "\r\n";
emailBody += "TIME:" + timev.value + "\r\n";
emailBody += "\r\n";
emailBody += "SITREPs";
emailBody += SITREPSv.value + "\r\n";
app.mailMsg({
bUI: true,
cTo: to.value,
cSubject: subject,
cMsg: emailBody
} );