0

I have to update an email address from a Queue via Apex, but I can't seem to get it right.

I have tried this, but it only returns null values..

for ( QueueSobject q : [SELECT Id, Queue.Name, Queue.Email FROM QueueSobject WHERE SobjectType='Case']){
system.debug('Name: '+q.Queue.Name+' -> '+q.Queue.Email);}

Anyone?

1
  • It is not the emailaddress of the queue members that I need to update but the email address of the queue itself (for sending notifications)
    – Wim
    Commented Nov 25, 2016 at 10:00

1 Answer 1

1

I found the answer to my question. You need to use the "Group" Object instead of QueueSobject.

Group[] grps = [SELECT Id, Name, Email FROM Group WHERE Type = 'Queue' AND Email != ''];
for (Group grp : grps) {
    grp.Email = null;
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .