Copy link to clipboard
Copied
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."
});
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).
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
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."
});
Copy link to clipboard
Copied
Are there any error messages in the JS Console?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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."
});
Copy link to clipboard
Copied
for some reason it is not reading the getField
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
Sent the file to your email
Copy link to clipboard
Copied
What did you enter in the fields?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
The fields are empty...
Copy link to clipboard
Copied
No