You need to sign in to do that
Don't have an account?
makeItRain
Queue Name = String
Hello,
I'm tired of racking my brain on what seems to be a simple trigger and hoping someone can help. I'm trying to asssign an effort level on our Leads based on the queue it's assigned to. I need to take the queue name and convert it to a string, where it'll match the same string value on an unrelated object. The first concern is I'm not even sure I'm doing this right. Am I even querying for the right queue objects? My trigger is as follows:
trigger updateLeadEffort on Lead (before insert) { Set<Id> ownerIds = new Set<Id>(); for (Lead l : Trigger.new) ownerIds.add(l.OwnerId); Map<Id, QueueSobject> q = new Map<Id, QueueSobject>([SELECT Id, Queue.Name from QueueSobject WHERE Id IN :ownerIds]); for (Lead l : Trigger.new) { if q.get(l.OwnerId).Name == customObjectField__c { l.effort__c = 'high'; } else { l.effort__c = 'none'; } } }
Any help on enlightening me would be awesome. Thank you.
looked at
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_queuesobject.htm
Gist is, queues are groups whose type are queues, so you need to perform a search on the group to find the queue's name.
All Answers
looked at
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_queuesobject.htm
Gist is, queues are groups whose type are queues, so you need to perform a search on the group to find the queue's name.
Ughh...that was too easy. Thank you.