How to get object name from Record Id in Salesforce?

Id myRecordId = 'a0V9000000KWdz3EAD';
String sObjName = myRecordId.getSObjectType().getDescribe().getName();

Leave a Reply