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
epani bisoftsolsepani bisoftsols 

how to get custom object id in salesforce?

Hello epani,
It is very easy to get the custom object id in Salesforce is like go to any record the starting 3 characters will be the id of object like Account object is 001 and Contact 003 and also custom object as well look in to url.

If it helpfull,please mark it as KUDOS for other benefits.

SFDC Developer.


       You can look into the URL or use this in console and type the respective sobject name to get its ID

Schema.DescribeSObjectResult r = Account.sObjectType.getDescribe();
String keyPrefix = r.getKeyPrefix();

From the above Code u can get the id of account object

Also look into this for more Info

Ramesh KallooriRamesh Kalloori

go through the below link to know how the id will be calculated in salesforce.