0

The below query works fine where setCaseId='hds88899889':

SELECT Id, DeveloperName FROM RecordType WHERE SObjectType ='Case' AND Id = :setCaseId

When I used it below not sure always results into no values

Set<Id> setCaseRTId = new Set<Id>();
for(case c : newCases) {  
    setCaseRTId.add(c.recordTypeId); 
} 
Map<Id, RecordType> caseMap = new Map<Id, RecordType>([ SELECT Id, DeveloperName
                                    FROM RecordType WHERE SObjectType ='Case' AND Id = :setCaseRTId]);
System.debug('Map Values ? : '+caseMap);
5
  • Are the values all null? What do you actually get as the output of setCaseRTId?
    – Adrian Larson
    Jul 26, 2017 at 18:45
  • setCaseRTId is comming with values which is correct
    – user46657
    Jul 26, 2017 at 18:53
  • 3
    No need to use SobjectType='Case', because Id values are always unique.
    – sfdcfox
    Jul 26, 2017 at 19:28
  • 1
    Looks like you need an IN in your query. AND Id IN :setCaseRTId
    – JRiffe
    Jul 26, 2017 at 21:33
  • @JRiffe Actually the filter works either way.
    – Adrian Larson
    Jul 27, 2017 at 0:26

0

You must log in to answer this question.