You need to sign in to do that
Don't have an account?
Sandra O
Unexpected Token: Illegal for Change of Ownership button
Hello - I am getting a Unekpected Token Illegal for my button to assign ownership to the person that clicks the button.
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
// identify the record
var c = new sforce.SObject("Checklist__c");
c.id = "{!Checklist__c.Id}";
// make the field change
c.Ownerid= {!$User.Id};
// save the change
sforce.connection.update([c]);
//refresh the page
window.location.reload();
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
// identify the record
var c = new sforce.SObject("Checklist__c");
c.id = "{!Checklist__c.Id}";
// make the field change
c.Ownerid= {!$User.Id};
// save the change
sforce.connection.update([c]);
//refresh the page
window.location.reload();
I needed to change c.Ownerid= {!$User.Id}; to c.OwnerId="{!$User.Id}"