You need to sign in to do that
Don't have an account?

Creating a custom case accept button for cases
Can someone develop a new button or show me how to do this. I am trying to create a custom button on cases to click if they want to accept the case. Which would only change the ownership and status of the case from new to working. If anyone can assist me with this I would be very appreciated. Thank you for the help in advance.
John
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';
caseObj.OwnerId = '{!$User.Id}';
var result = sforce.connection.update([caseObj]);
if (result[0].success=='false') {
alert(result[0].errors.message);
} else {
window.parent.location.href="/{!Case.Id}/e?retURL=%2F{!Case.Id}";
}
Display type = Detail Page Button
Behavior = Execute JavaScript
This will auto assin the user to the case and take them to the edit screen.
Display Type: Detail page Button
Behaviour: Execute Javascript
Content source :Onclick Javascript
This doesnt change the owner to the user that clicked the button. but it does change the status of case.
Hi,
Yes, this does happen with above code.
I just gave a sample code which you might need to update/upgrade as per your requirement.
I think by adding below simple statement you will get what you are looking for...
caseObj.OwnerId = '{!$User.Id}';
complete code will look like