You need to sign in to do that
Don't have an account?
devendra dhaka
HOW TO ASSOCIATE MULIPLE OBJECTS TO A QUEUE USING APEX
i AM CREATING A QUEUE USING Group and queuesobject . standard objects.
in the "queuesobject" there is a field 'sobjectType' where we associate supported objects to the queue.
But using apex code we are only able to attach a single object to it..
queuesobject q = new queuesobject (queueid=groupt.id, sobjecttype='test__c'); /// this line
how can we achieve this...
what is the issue with this you are having...??
When we create a queue using setup -> administration -> manage user -> queue
we can associate multiple objects to the queue.
but using QUEUE OBJECT we can only add a single object to the queue
how can we achieve this ??
Have you tried ??
queuesobject q = new queuesobject (queueid=groupt.id, sobjecttype='test__c;Lead;Case');
No it din't work.
System.DmlException: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Sobject Type: bad value for restricted picklist field: test__c;lead;case: [SobjectType]
'm gettin above error
sorry you have to do like this :
List<queuesobject > qus = new List<queuesobject >();
queuesobject q1 = new queuesobject (queueid=groupt.id, sobjecttype='test__c');
qus.add(q1);
queuesobject q2 = new queuesobject (queueid=groupt.id, sobjecttype='Lead');
qus.add(q2);
queuesobject q3 = new queuesobject (queueid=groupt.id, sobjecttype='Case');
qus.add(q3);
Note that the groupt.id will be same for all of them.....