Showing posts with label Default. Show all posts
Showing posts with label Default. Show all posts
Monday, December 2, 2019
Wednesday, August 14, 2019
How to get Default Record Type Id of object using apex in salesforce
In this example, I am getting Account object default record type Id
Example
Result
Example
Schema.DescribeSObjectResult describeResult = Account.getsObjectType().getDescribe();
List<Schema.RecordTypeInfo> rtInfos = describeResult.getRecordTypeInfos();
for(Schema.RecordTypeInfo rtInfo : rtInfos) {
if(rtInfo.isDefaultRecordTypeMapping()) {
System.debug('Default Record Type Id ====> '+rtInfo.getRecordTypeId());
}
}
Result
Labels:
Apex,
Default,
Record Type Id,
Salesforce
Subscribe to:
Posts (Atom)