You need to sign in to do that
Don't have an account?
The Real Jonah Hust
Custom button - check owner type prior to action (Java)
I should start by saying I know very little about Java. I have pieced together a custom button that is used to update the open case record. The button works flawlessly, but I want to add code to check if its assigned to a user, and if it is, execute only the portion of the code that changes the priority. If its assigned to a queue, then the changes for Owner, Priority, and Status would need to execute.
The code current code I have is:
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';
caseObj.OwnerId = '00G36000001rInD';
caseObj.Status = "Ready to Move Forward";
caseObj.Priority = 'High'
var result = sforce.connection.update([caseObj]);
window.location.href=window.location.href;
The code current code I have is:
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';
caseObj.OwnerId = '00G36000001rInD';
caseObj.Status = "Ready to Move Forward";
caseObj.Priority = 'High'
var result = sforce.connection.update([caseObj]);
window.location.href=window.location.href;
Try this and let me know if it works.
All Answers
Try this and let me know if it works.
Thank you very much Swati. Greatly appreciated.