I'm constructing a button that a user can click once they've opened a case to take ownership and set the status to active. Although I had the code pretty close, but I'm getting an error I'm not familiar with.
Here's my code:
{!REQUIRESCRIPT("/soap/ajax/23.0/connection.js")}
var url = parent.location.href;
var record = {!GETRECORDIDS($ObjectType.Case)}; //Looking for current case ID
var updateRecord;
var update_Case = new sforce.SObject("Case");
update_Case.Id = record;
update_Case.User = {!$User.Id};
update_Case.Status = "Active";
updateRecord.push(update_Case);
result = sforce.connection.update(updateRecord);
parent.location.href = url;
I'm getting this error:
A problem with the OnClick JavaScript for this button or link was encountered:
identifier starts immediately after numeric literal