The Case Owner should change to who ever is the current Support Owner, when Resolution Type is changed to "Escalate Client Services", Unless Support Owner is blank. (I have another workflow in place to take care of this part).
Current Object: Case Fields:
Case Owner (Lookup)
Support Owner (Custom Field, Formula, Lookup) populated originally on the Account Object
Resolution Type (Picklist).
I'm fairly new to Apex Triggers so if that's the path I need to take, I would appreciate any assistance. :)
To change Owner, workflow is only good when changing to a specific owner (such as a queue or an admin). Otherwise, you have to have workflows for each support rep.
So, its a trigger you need. An an example, here is a trigger that updates a field in the same way when we escalate a case, so that we know the original owner.
trigger updateOriginalOwnerontoEscalatedCase on Case (before update) {
List<Case> Caseupdates = new List<Case>(); Caseupdates = Trigger.new;
The "Startswith 005" is important is you use queues. Case Owner is polymorphic in that is can be User or Queue ID. Updating a custom field tied to User would break if a queue owned the case, so we use the "Start with" to make sure the object is a user object who owns the case. We also eliminate cases of certain origins as they auto-escalate and wouldnt have an owner we needed to track.
To change Owner, workflow is only good when changing to a specific owner (such as a queue or an admin). Otherwise, you have to have workflows for each support rep.
So, its a trigger you need. An an example, here is a trigger that updates a field in the same way when we escalate a case, so that we know the original owner.
trigger updateOriginalOwnerontoEscalatedCase on Case (before update) {
List<Case> Caseupdates = new List<Case>(); Caseupdates = Trigger.new;
The "Startswith 005" is important is you use queues. Case Owner is polymorphic in that is can be User or Queue ID. Updating a custom field tied to User would break if a queue owned the case, so we use the "Start with" to make sure the object is a user object who owns the case. We also eliminate cases of certain origins as they auto-escalate and wouldnt have an owner we needed to track.
To change Owner, workflow is only good when changing to a specific owner (such as a queue or an admin). Otherwise, you have to have workflows for each support rep.
So, its a trigger you need. An an example, here is a trigger that updates a field in the same way when we escalate a case, so that we know the original owner.
trigger updateOriginalOwnerontoEscalatedCase on Case (before update) {
List<Case> Caseupdates = new List<Case>();
Caseupdates = Trigger.new;
for (Case Caseupdate : Caseupdates) {
if (Caseupdate.IsEscalated == True && Caseupdate.Original_Owner__c == NULL && Caseupdate.Origin != 'Email Installation' && Caseupdate.Origin != 'Form SecResponse' && String.valueOf(CaseUpdate.ownerId).startsWith('005')) {
try {
Caseupdate.Original_Owner__c = Caseupdate.OwnerId;
}
catch (Exception e) {
//
}
}
}
}
The "Startswith 005" is important is you use queues. Case Owner is polymorphic in that is can be User or Queue ID. Updating a custom field tied to User would break if a queue owned the case, so we use the "Start with" to make sure the object is a user object who owns the case. We also eliminate cases of certain origins as they auto-escalate and wouldnt have an owner we needed to track.
All Answers
When workflow and trigger both can perform an action workflow is prefered as it provides more configurability. To compare your case See Trigger vs WorkFlow : http://forceschool.blogspot.com/2011/05/hi-all-triggers-are-very-essential-in.html
Do you have any suggestions on how I would create a workflow to make this happen?
Thanks
Nancy
To change Owner, workflow is only good when changing to a specific owner (such as a queue or an admin). Otherwise, you have to have workflows for each support rep.
So, its a trigger you need. An an example, here is a trigger that updates a field in the same way when we escalate a case, so that we know the original owner.
trigger updateOriginalOwnerontoEscalatedCase on Case (before update) {
List<Case> Caseupdates = new List<Case>();
Caseupdates = Trigger.new;
for (Case Caseupdate : Caseupdates) {
if (Caseupdate.IsEscalated == True && Caseupdate.Original_Owner__c == NULL && Caseupdate.Origin != 'Email Installation' && Caseupdate.Origin != 'Form SecResponse' && String.valueOf(CaseUpdate.ownerId).startsWith('005')) {
try {
Caseupdate.Original_Owner__c = Caseupdate.OwnerId;
}
catch (Exception e) {
//
}
}
}
}
The "Startswith 005" is important is you use queues. Case Owner is polymorphic in that is can be User or Queue ID. Updating a custom field tied to User would break if a queue owned the case, so we use the "Start with" to make sure the object is a user object who owns the case. We also eliminate cases of certain origins as they auto-escalate and wouldnt have an owner we needed to track.