Skip to main content

Button with JavaScript Update



{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var l = new sforce.SObject("Opportunity");
l.id = "{!Opportunity.Id}";
l.field__c = true;
result = sforce.connection.update([l]);

alert('This may take a minute to calculate.');

//delaying reload to help get the api time
setTimeout("window.location.reload()", 100);

Comments

Popular posts from this blog

Override Name in the Salesforce Cloud Console

Service Cloud Console HyperLink Opens new window outside of the console, Opens new tab inside the console. HYPERLINK("javascript:if(typeof(srcUp)=='function') {srcUp('/" & Id & "?isdtp=vw');}"+ " else {window.location.href='/" & Id & "'}", User__r.FirstName + ' ' + User__r.LastName, "_self" ) Checks if the srcUp exists and if it does, you're in the console.