You can see in the example below that I'm using the OwnerId to check who's the owner of the case (it isn't pretty but it works).
But what if I have 100 users? Can someone suggest a solution for this?
List < Case > listOfCases = [SELECT Id, OwnerId FROM Case WHERE RecordTypeId IN: setRecordTypeIds];
for (Case c: listOfCases) {
if (c.OwnerId == '005w0000004CjwgAAC') {
//do something....
}
}
Is there a way to query the case owner name?