You need to sign in to do that
Don't have an account?
Yuckle
Display Orginal Case Owner Name
I would iike to display the name of the original case owner on the case page after a case is reassigned. I have created a field Level 1 Owner Id where I capture the original owner id upon reassignment. But, I have been unable to figure out how to the display the name of the original owner from the id value stored in Level 1 Owner Id. There must be a way.. Please help.
Hi,
Lookup fields we can not update dynamically using Workflow field update.
May be you might need to write a small trigger on Case object looks like below.
trigger OldOwnerNameUpdate on Case(before update){
for(Case c : Trigger.New){
if(Trigger.OldMap.get(c.Id).OwnerId != c.OwnerId)
c.Level_1_Owner_Id = a.OwnerId;
}
}
Thanks,
Kodisana
All Answers
Hi,
Create a Level 1 Owner Id as Lookup to User object and then populate the OwnerId to this field.
Then User Name will show automatically.
Thanks,
Kodisana
Okay. How do I populate this field once created as a lookup field to user to User, with a Field Update?
Hi,
Lookup fields we can not update dynamically using Workflow field update.
May be you might need to write a small trigger on Case object looks like below.
trigger OldOwnerNameUpdate on Case(before update){
for(Case c : Trigger.New){
if(Trigger.OldMap.get(c.Id).OwnerId != c.OwnerId)
c.Level_1_Owner_Id = a.OwnerId;
}
}
Thanks,
Kodisana
Thanks. I'll get it a try
It works! Here's the final version:
trigger CaptureLevel1Owner on Case (before update) {
for(Case c: Trigger.new) {
String caseLevel2 = 'Level 2';
if (Trigger.isUpdate) {
if (c.Level__c == caseLevel2) {
if (c.Level_1_Owner__c == null)
c.Level_1_Owner__c = c.Level_1_Case_Owner_Id__c;
}
}
}
}
I built this is the Sandbox. How do I get it into production?
Hi,
To migrate the code to the Production you have to write test class for code coverage.
after that you need to use Force.com Migration tool OR Ant tool to migrate the code to the Production.
Below is the sample code for test class:
Thanks,
Kodisana