You need to sign in to do that
Don't have an account?
Richard Pitfield 10
I have created the below script for a button on the lead object
I have created the below script for a button on the lead object, it should tick the field Faculty Trial Request but doesn't any help appreciated, I've run this with for anotehr field Lead.Product in place of the Lead.FacultyTrial test field and it works fine.
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Lead");
if("{!Lead.Faculty_Trial_test__c}" == "no") {
alert("You can only request a Faculty Trial to SRM, Business or SAGE Video products. Pleae make sure you have added at least one of these products to the related Opportunity.");
}
if("{!Lead.Department__c}" == "") {
alert("You must add a Department to request a Faculty Trial.");
}
if("{!Lead.Email}" == "") {
alert("You must add an Email to request a Faculty Trial.");
} else {
c.id ="{!Lead.Id}";
c.Faculty_Trial_Request__c = false;
c.Faculty_Trial_Request__c = true;
newRecords.push(c);
result = sforce.connection.update(newRecords);
window.location.reload();}
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Lead");
if("{!Lead.Faculty_Trial_test__c}" == "no") {
alert("You can only request a Faculty Trial to SRM, Business or SAGE Video products. Pleae make sure you have added at least one of these products to the related Opportunity.");
}
if("{!Lead.Department__c}" == "") {
alert("You must add a Department to request a Faculty Trial.");
}
if("{!Lead.Email}" == "") {
alert("You must add an Email to request a Faculty Trial.");
} else {
c.id ="{!Lead.Id}";
c.Faculty_Trial_Request__c = false;
c.Faculty_Trial_Request__c = true;
newRecords.push(c);
result = sforce.connection.update(newRecords);
window.location.reload();}