1

I have a custom object: Ticket__c

In that object I added a custom button, and I want to update an attribute of the object (Escalate__c) from false to true, I am not sure how to do this right now I have something like this:

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
var result = sforce.apex.execute("evticket__c" : true);
alert(result);
window.location.reload();

Thanks

3

Your JavaScript isn't quite right, but unless you've written a method for this, it'd be easier to update the record directly:

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
var record = new sforce.SObject("Ticket__c");
    record.Id = "{!Ticket__c.Id}";
    record.Escalate__c = true;
var result = sforce.connection.update([record]);
// check the result here
window.location.reload();
| improve this answer | |
  • Thanks, this worked. I was so lost on the syntax, sorry. lol – Rodrigo Zurek Jan 22 '15 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.