Instead of using this:
[Select id from RecordType where sObjectType = 'Account' and developerName ='Customer'].id
Use this:
Schema.SObjectType.Account.getRecordTypeInfosByName().get('Customer').getRecordTypeId()
This can help avoid those pesky SOQL governor limits.
0 Comments