+ Start a Discussion
Steve HarrisonSteve Harrison 

Need javascript to trigger an edit/save cycle

I have created a custom escalate button that updates the Case Status to "Escalated" and ultimately triggers an assignment rule. However, the updated status doesn't display or trigger the assignment rule until I manually edit and save that case. Is there a way to add javascript code to my escalate button that will trigger an automatic edit/save cycle or is there a better way to do this?

Thanks in advance.

Steve
Best Answer chosen by Steve Harrison
Suneel#8Suneel#8
Use below javascript code om the button to update the status to Escalated
{!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")}  

var c = new sforce.SObject("Case");
c.id = "{!Case.Id}";
c.Status = "Escalated";
var result = sforce.connection.update([c]);

 

All Answers

Suneel#8Suneel#8
Use below javascript code om the button to update the status to Escalated
{!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")}  

var c = new sforce.SObject("Case");
c.id = "{!Case.Id}";
c.Status = "Escalated";
var result = sforce.connection.update([c]);

 
This was selected as the best answer
Steve HarrisonSteve Harrison
Thanks Suneel#8!