I created a custom label AccRecordTypes in that I added 2 record type Names as Partner Account, Customer Account.
In my class I am trying to fetch Account records that has record type name as Partner or customer Account. But when the custom label has only single record type name Partner Account or Customer Account it is fetching the records otherwise the list is coming as null even though we have some records. Not sure what I am missing here, can anyone please guide me?
String recordtypes = System.Label.AccRecordTypes;
Set<String> AccRecTypeSet = new Set<String>();
if(recordtypes != null)
{
for(String str : recordtypes.split(','))
{
AccRecTypeSet.add(str);
}
}
System.debug('AccRecTypeSet-->'+AccRecTypeSet);// debug shows as {Partner Account, Customer Account}
List<Account> accl = [Select Id,Name,RecordType.Name from Account where RecordType.Name IN:AccRecTypeSet];
system.debug('===='+accl);