2 个回答
Hi Sarma,
But let me tell you it can be done via config using formula field of text type.Hope it helps. If it does, close it by marking it as solved.Thankstrigger on case(before Insert) {
if(Trigger.isBefore && Trigger.isInsert) {
TriggerHandler.handleBeforeInsert(Trigger.new);
}
}
public class TriggerHandler {
public static void handleBeforeInsert(List<Case> newCaseList) {
Set<String> caseIdSet = new Set<String>();
for(Case newCase : newCaseList) {
caseIdSet.add(newCase.OwnerId);
}
// Create a map of String with Owner
// Loop over the newCaseList
and assign newCase.TextField = map.get(key).Name;
}
}