You need to sign in to do that
Don't have an account?
Adriana Voyce
Javascript error on working button
Hi! I created a button that is supposed to check a checkbox on an opportunity and open a window which allows a use to download a docoument....
The button works, the checkbox is checked and the window pops up to download, but when I click the button an error appears first and then the window pops up... How do I get rid of this error?
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Opportunity");
c.id ="{!Opportunity.Id}";
c.Voice_Referal__c = true;
newRecords.push(c);
result = sforce.connection.update(newRecords);
window.location.replace('/apex/SDOC__SDCreate1?id={!Opportunity.Id}&Object=Opportunity')();
The button works, the checkbox is checked and the window pops up to download, but when I click the button an error appears first and then the window pops up... How do I get rid of this error?
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Opportunity");
c.id ="{!Opportunity.Id}";
c.Voice_Referal__c = true;
newRecords.push(c);
result = sforce.connection.update(newRecords);
window.location.replace('/apex/SDOC__SDCreate1?id={!Opportunity.Id}&Object=Opportunity')();
Please check below post for more example on same
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BQRHIA4
Please let us know if this will help you
Thanks,
Amit Chaudhary
All Answers
Please check below post for more example on same
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BQRHIA4
Please let us know if this will help you
Thanks,
Amit Chaudhary