Sunday, 12 August 2012

Define & Insert Queues in Apex Triggers & Test Classes?

It's a two step process:

            Group g1 = new Group(Name='group name', type='Queue');
            insert g1;
            QueuesObject q1 = new QueueSObject(QueueID = g1.id, SobjectType = 'Lead');
            insert q1;

No comments:

Post a Comment

Labels