how to get object name from id value in salesforce

Use below Id method to get Object name from Id type.

Id myId ='00390000023cCFk';
String sObjName = myId.getSObjectType().getDescribe().getName();
System.debug('sObjName: '+sObjName);

I hope this will help you.

Comments

Popular posts from this blog

Custom Setting Creation in Apex Test Class

System.AsyncException: The Apex job named is already scheduled for execution.

Salesforce Trace Log Query Using Apex

AJAX Toolkit Debug Shell

How to Query All the batch classes in your Salesforce Instance using APEX

Error : "Trigger must be associated with a job detail"

Prefix List Of Salesforce Object

how to get object name from id / prefix value in salesforce

Creating Salesforce Developer Account

Recurring Scheduling Apex Job for every 10,15 etc minutes