You need to sign in to do that
Don't have an account?
Richard Pitfield 10
Hi there,
Below is some code I have in a custom button to tick a checkbox that runs a workflow rule
It has worked for almost a year and has now jut stopped working and I don't know why.
It runs the alerts but doesn't check the faculty Trial request box anymore, any help appreciated.
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Lead");
console.log("{!Lead.Faculty_Trial_test__c}");
if
("{!Lead.Faculty_Trial_test__c}" == "no")
{
alert("You can only request a Faculty Trial to SRM, Business or SAGE Video products. Plesae 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();}
Custom Javascript Button that worked for months has stopped working?
Hi there,
Below is some code I have in a custom button to tick a checkbox that runs a workflow rule
It has worked for almost a year and has now jut stopped working and I don't know why.
It runs the alerts but doesn't check the faculty Trial request box anymore, any help appreciated.
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Lead");
console.log("{!Lead.Faculty_Trial_test__c}");
if
("{!Lead.Faculty_Trial_test__c}" == "no")
{
alert("You can only request a Faculty Trial to SRM, Business or SAGE Video products. Plesae 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();}
Please try this,
You have missed {!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")} i suppose.
Thanks,
Prosenjit
All Answers
Please try this,
You have missed {!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")} i suppose.
Thanks,
Prosenjit