Copy link to clipboard
Copied
I have been reading through the community posts and can't find an answer that covers my specific requirement.
I have a form to be completed across multiple areas of our organisation. However, if Area1 completes the form then it must be sent to Person1 for approval, however, if Area2 completes the form then it must be sent to Person2.
I tried using the following, predicated on Area2 being checked or not checked, but when I hit the submit button person2's email is always populated in the email to address field regardless of the check button being on or off, so I am not sure what my error is :
var cToAddr1 = "person1@organisation.com"
var cToAddr2 = "person2@organisation.com"
var a1 = this.getField("Area2")
var cSubLine = "Form to be Approved"
var cBody = "Please find attached my Form for your approval"
if (a1 == "Off" )
this.mailDoc({bUI: true, cTo: cToAddr1, cSubject: cSubLine, cMsg: cBody});
else
{
this.mailDoc({bUI: true, cTo: cToAddr2, cSubject: cSubLine, cMsg: cBody});
}
Any help would be greatly appreciated.
🙂
Copy link to clipboard
Copied
Use:
var a1 = this.getField("Area2").value;
Copy link to clipboard
Copied
Grrrr I knew it was something that simple.
Thank you very much that worked wonderfully.