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

1 Answer 1

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();
1
  • Thanks, this worked. I was so lost on the syntax, sorry. lol Commented Jan 22, 2015 at 16:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .