Identify if a Salesforce Object is Custom or Standard Identify if a Salesforce Object is Custom or Standard using isCustom in apex Post author:Swapnil Jaiswal Post published:March 8, 2023 Post category:Blog / Salesforce Overview Here you will learn how to Identify if a Salesforce Object is Custom or Standard using isCustom in apex. Code snippets Here is the code to loop through all salesforce objects and check if the object is standard or custom object. Boolean isCustomObject = true; for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values()) { SObjectType objInfo = Schema.getGlobalDescribe().get(objTyp.getDescribe().getName()); if(objInfo != null) { isCustomObject = objInfo.getDescribe().isCustom(); System.debug('Object Name = ' + objTyp.getDescribe().getLabel() + ' === Is Custom = ' + isCustomObject); } } The code given below check if specific object is Custom or Standard Object. In my case cbugs__Student__c is a Custom object. Boolean isCustomObject = true; for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values()) { if(objTyp.getDescribe().getName() == 'cbugs__Student__c') { SObjectType objInfo = Schema.getGlobalDescribe().get(objTyp.getDescribe().getName()); if(objInfo != null) { isCustomObject = objInfo.getDescribe().isCustom(); } if(isCustomObject) { System.debug(objTyp.getDescribe().getName() + ' Custom object'); } else { System.debug(objTyp.getDescribe().getName() + ' Standard object'); } } } getName() used to get API NAME of Salesforce object. By using getLabel() method we can find label of any Salesforce object. See in action - How to identify Standard & Custom Salesforce Objects You Might Also Like How to sort array of object alphabetically in lwc salesforce. January 21, 2022 360 Degree Cloud Technologies – Salesforce Developer Interview Questions September 26, 2024 Easiest way to implement pagination in Lightning Web Component January 24, 2025 Auto Masked / Format Phone number as per given country phone format | JavaScript | LWC | Validate Phone Number. March 5, 2022 Asking for multiple permissions in android Java September 19, 2022 How can I make a Currency field required on the Salesforce record page? March 6, 2026
Auto Masked / Format Phone number as per given country phone format | JavaScript | LWC | Validate Phone Number. March 5, 2022