+ Start a Discussion
kailash chandra 25kailash chandra 25 

how to differentiate standard object and custom object by Id ?

Using apex how can i differentiate between standard object and custom object?
I have an Id Type of object that might be either a standard object or custom object.
Best Answer chosen by kailash chandra 25
Murali MattaMurali Matta
Hi Kailash,

When you click on object in salesforce in the URL you can find 3 digit id. Salesforce predefined id's for Standard object.
Below are the id's for standard objects.

http://salesforcedevelopersclub.blogspot.com/2013/07/salesforce-object-id-prefixes.html
001	Account
002	Note
003	Contact
005	User
006	Opportunity
500	Case
701	Campaigns
007	Activity
00B	ListView / View
00D	Organization
00E	UserRole
00G	Group
00I	Partner
00O	Report
00P	Attachment
00Q	Lead
00T	Task
00U	Event
00X	EmailTemplate
00Y	EmailTemp
00e	Profile
00h	Layout – Page Layout
00i	Pricebook
00j	Product
00k	OpportunityLineItem
00l	Folder
00v	CampaignMember
01Z	Dashboard
01a	DashboardComponent
01s	Pricebook2
01t	Product2
02c	Sharing Rule
03u	UserPreference
800	Contract
801	Order
802	OrderItem
806	Approval

Let me know if you have any confusion.

Kindly mark this as solved if the reply was helpful.

Thanks,
Murali

All Answers

Raj VakatiRaj Vakati
You can differentiate the standard object and custom object by using API name easily 

All Custom object ends with __c whereas standard object does not end with __c
Murali MattaMurali Matta
Hi Kailash,

When you click on object in salesforce in the URL you can find 3 digit id. Salesforce predefined id's for Standard object.
Below are the id's for standard objects.

http://salesforcedevelopersclub.blogspot.com/2013/07/salesforce-object-id-prefixes.html
001	Account
002	Note
003	Contact
005	User
006	Opportunity
500	Case
701	Campaigns
007	Activity
00B	ListView / View
00D	Organization
00E	UserRole
00G	Group
00I	Partner
00O	Report
00P	Attachment
00Q	Lead
00T	Task
00U	Event
00X	EmailTemplate
00Y	EmailTemp
00e	Profile
00h	Layout – Page Layout
00i	Pricebook
00j	Product
00k	OpportunityLineItem
00l	Folder
00v	CampaignMember
01Z	Dashboard
01a	DashboardComponent
01s	Pricebook2
01t	Product2
02c	Sharing Rule
03u	UserPreference
800	Contract
801	Order
802	OrderItem
806	Approval

Let me know if you have any confusion.

Kindly mark this as solved if the reply was helpful.

Thanks,
Murali
This was selected as the best answer