I have a drop-down object (SupervisorList), a textfield (EmployeeEmail) and button object (SupervisorEmail). When the SupervisorEmail button is clicked, three things need to happen;
I'm at a loss on how to accomplish this. This is my script:
Form1.Subform3.Approvals.Supervisor.SupervisorEmail::click - (JavaScript, client)
var vEmail;
var vSubject = "Vacation/Personal Leave Request";
var vBody = "Comments:";
var vCC;
if (EmployeeInfo.SupervisorList.rawValue !== null) {
vEmail = EmployeeInfo.SupervisorList.rawValue;
}
if (this.rawValue == "person1@company.com" || this.rawValue == "person2@company.com" || this.rawValue == "person3@company.com"){
"&cc" = "person4@company.com" + ";";
}
if (EmployeeInfo.EmployeeEmail.rawValue !== null){
vCC = "&cc=" + EmployeeInfo.EmployeeEmail.rawValue;
}
else if (EmployeeInfo.EmployeeEmail.rawValue === null) {
vCC = "&cc=";
}
{
// Send email
event.target.submitForm({cURL:"mailto: " + vEmail + "?subject=" + vSubject + "&body=" + vBody + vCC,cSubmitAs:"PDF",cCharset:"utf-8"});
}
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
I think you may have seen this example: http://assure.ly/dYQFb4.
If you have a look you will see how I deal with the CC part of the script. You certainly have an error there at the moment.
For example if the script is in the SupervisorEmail button, then it wont have a .rawValue. Therefore you need to refer to the dropdown AND not "this".
Also when setting the vCC variable, you need this:
var vCC = "";
Then you could deal with declaring of the vCC:
if (SupervisorList.rawValue == "person1@company.com" || SupervisorList.rawValue == "person2@company.com" || SupervisorList.rawValue == "person3@company.com") {
vCC = "&cc" + "person4@company.com" + "; ";
}
if (EmployeeInfo.EmployeeEmail.rawValue !== null) {
if (vCC == "") {
vCC = "&cc=" + EmployeeInfo.EmployeeEmail.rawValue;
}
else {
vCC = vCC + EmployeeInfo.EmployeeEmail.rawValue;
}
}
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
I think you may have seen this example: http://assure.ly/dYQFb4.
If you have a look you will see how I deal with the CC part of the script. You certainly have an error there at the moment.
For example if the script is in the SupervisorEmail button, then it wont have a .rawValue. Therefore you need to refer to the dropdown AND not "this".
Also when setting the vCC variable, you need this:
var vCC = "";
Then you could deal with declaring of the vCC:
if (SupervisorList.rawValue == "person1@company.com" || SupervisorList.rawValue == "person2@company.com" || SupervisorList.rawValue == "person3@company.com") {
vCC = "&cc" + "person4@company.com" + "; ";
}
if (EmployeeInfo.EmployeeEmail.rawValue !== null) {
if (vCC == "") {
vCC = "&cc=" + EmployeeInfo.EmployeeEmail.rawValue;
}
else {
vCC = vCC + EmployeeInfo.EmployeeEmail.rawValue;
}
}
Hope that helps,
Niall
Views
Replies
Total Likes
Yes, I have been reviewing those examples. Thank you for your help.
-Don
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies