function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sandra OSandra 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();
Best Answer chosen by Sandra O
Sandra OSandra O
Answered my own question...

I needed to change c.Ownerid= {!$User.Id}; to c.OwnerId="{!$User.Id}"