Ask Search:
Joe ParryJoe Parry 

Problem with custom button on case

I have a similar button across multiple objects in our org but I can't get it to work on the Case. What I have going is a checkbox triggers a flow to run through case escalation. Here is the Javascript I have in place:

    {!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")} 
    var newRecords = []; 
    var c = new sforce.SObject("Case"); 
    c.id ="{!Case.Id}";
    c.Case.Escalate__c = true;
    newRecords.push(c);
    result = sforce.connection.update(newRecords);
    window.location.reload();

And this is the error I'm getting when I click the custom button

    A problem with the OnClick JavaScript for this button or link was encountered:
   Cannot set property 'Escalate__c' of undefined
Best Answer chosen by Joe Parry
Steve BainesSteve Baines
change c.Case.Escalate__c = true to c.Escalate__c = true

All Answers

Steve BainesSteve Baines
change c.Case.Escalate__c = true to c.Escalate__c = true
This was selected as the best answer
Joe ParryJoe Parry
Thank you!