Play Games

Search This Blog

Monday, May 8, 2017

How to check an object is a custom setting or not in Salesforce?

By using isCustomSetting() of DescribeSObjectResult class,We can check whether the object is a custom setting or not.
If method returns true,its custom setting else it's not a custom setting.
Examples:
Sample Code:
Schema.DescribeSObjectResult d = Account.sObjectType.getDescribe();
system.debug('IS custom Setting : '+ d.isCustomSetting());
Output : 

I created custom Setting Endpoint__c as shown in image below

Sample Code :
Schema.DescribeSObjectResult d = Account.sObjectType.getDescribe();
system.debug('IS custom Setting : '+ d.isCustomSetting());
Output:


No comments:

Post a Comment