Play Games

Search This Blog

Tuesday, November 3, 2015

How to query records based on record type name in apex

Suppose "Supplier" is the record type name in Account object
Then the query to retrieve accounts of this recordtype is
list<Account> accountList =[select id,name,recordtypeId from Account where recordType.name=:'Supplier'];
system.debug('accountListaccountList'+accountList );