function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mohit Srivastavamohit Srivastava 

Object type

I want to get the object name and object type (custom/standard) by schema.get describe .how i achieve this functionality
Abhishek BansalAbhishek Bansal

Hi Mohit,

Please use below Syntax :

For getting Name :
YourObject.SObjectType.getDescribe().getName();
Result :
It will return the API Name

For Getting Standard or Custom Object :
YourObject.SObjectType.getDescribe().isCustom();
Result :
It will return true if Object is Custom

Note : Replace yourObejct with API name of your object

Let me know if you need more help.

Thanks,
Abhishek Bansal.