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 answers
0/9000