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 个回答