You need to sign in to do that
Don't have an account?
KT@Cisco
How to identify case owner as either a User or a Queue
I need to identify for a given case whether the owner of the case is a queue or an agent.
When I query the CASE table for OwnerId field, it gives me different string values and I was hoping to identify how to differentiate between whether this OwnerId references a Queue or if it references an agent.
Any clues?
All Answers
Okay new problem with that idea. Everytime I attempt to capture Case.Owner.Type within the trigger on a before insert, before update it shows Owner.Type as null. Any ideas?
trigger CaseOwnerTypeTrigger on Case (before insert, before update) { for(Case c : Trigger.new) { c.Owner_Type__c = c.Owner.Type; }}
Genius I love it, thanks again.
For anyone else trying to find the solution, create a field on the case called Owner Type then use the trigger below:
trigger CaseOwnerTypeTrigger on Case (before insert, before update) {
for(Case c : Trigger.new)
{
//c.Owner_Type__c = c.Owner.Type; // won't work, always returns null for some reason
String ownId = c.OwnerId; // necessary to convert ID to string
c.Owner_Type__c = (ownId.substring(0,3) == '005' ? 'User' : 'Queue');
}
}
Hi,
I understand that, you have workaround to check whether Owner is User or Queue (using first 3 chars). But you have any idea about why "Owner.Type" always returns null? Is it because we are in before trigger context or we need to query for Owner.Type rather than using from Trigger.new as it is not cashed in Trigger.New context variable.
Thanks,
V.R.
Thanks .. I had thought same and that makes sense.
Regards,
V.R.
I have it latest/exact dumps for ADM 201 SU'17. i have passed two days before. if anybody wants contact me leninraj2017@gmail.com.
Hi, I have all latest dumps of salesforce for all types of salesforce exams if anyone wants you can mail me at
cloudtutorialstraining@gmail.com
1.Salesforce Administrator (ADM 201) http://www.latestdumps.net/ADM-201.htm 49$
2.Salesforce DEV-401 Exam /*Salesforce DEV-401 Braindumps /* http://www.latestdumps.net/DEV-401.htm 49$
3.Salesforce DEV-501 Exam
4. Salesforce Administrator (ADM 211)
5.Salesforce sales cloud
Immediately i will sent dumps latest one,which helps you to pass
cloudtutorialstraining@gmail.com