You need to sign in to do that
Don't have an account?
devendra dhaka
Queue creation using apex triggers
I AM USING THIS CODE IN A TRIGGER TO AUTOMATE CREATION OF THE QUEUES .
Group g=new Group(Name='hello', Type='QUEUE');
insert g;
QueuesObject q= new QueuesObject (queueid=g.id, sobjectType='lead');
insert q; /// error is represented in this line
I am using this trigger on an object insertion.
If i use the same code in a visualforce page using apex controller, it works....
thanks in advance....
PLEASE use only one question and do not repeat the question in different treads , which creates confusion.
Please let us know the error you are getting.....
Review all error messages below to correct your data.
Apex trigger queueCreator caused an unexpected exception, contact your administrator: queueCreator: execution of BeforeInsert caused by: 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: [SobjectType]: Class.QueueCreator.createQueue1: line 25, column 1
This is the error 'm getting...
I have written a trigger to create a queue , by uploading the data into a temp object 'test'
queuesobject q = new queuesobject (queueid=groupt.id, sobjecttype='test__c;Lead;Case');
you entered the wrong answer in this question thread...
how do i resolve this error ??