I am trying to build a button in the list view to:
- Change case ownership to the current user
- Change the case status to work in progress
I have the following code in the detail page that works fine:
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}
var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';
caseObj.OwnerId = '{!$User.Id}';
caseObj.Status = "Work In Progress";
var result = sforce.connection.update([caseObj]);
window.location.href=window.location.href;
but when I put the button in the list view and click on the button, nothing happens. it is configured to execute java script as behavior and contentsouce is set to on clickjavascript
Could you guys please provide me some light?