Skip to main content
I need to populate a MAP with user ID and Name for use on an activity object but when the user is a queue it returns the queue SFDC ID.

 

map<string,string> mapUsers = new map<string,string>{};

 

   for (User hd :[Select ID, name from User]) {

 

      mapUsers.put(hd.id, hd.Name);

 

   }

 

   For (Case MyCases2 :trigger.new) {

 

      MissingLogs.Add(New MHDActivities__c ( OwnerID = thisID, Name = mapUSers.get(thisid)));

 

   }

 

The "Name" field in the last line of the above snippet returns the User name if it is a user but a an ID if its a queue. Can I get the name of the queue.

 

Thanks
2 Antworten
  1. 15. Dez. 2011, 15:41
    You will find queue name in object Group:

     

    Select g.Type, g.Name, g.Id, g.Email, g.DoesSendEmailToMembers, g.DoesIncludeBosses

     

    From Group g

     

    Nash
0/9000