Identify SObject Name with Record Id

Apex Dec 17, 2014

Ever wondered how to find Salesforce Object name with Record Id?

Here is solution,

// pass record Id for which you want to find sObject Name
Id recordId = 'a099000000h6Nw9'; 
// recordId.getSObjectType() is responsible for getting sObject Name
system.debug(recordId.getSObjectType());

Happy Coding!!!

Phanindra Mangipudi

Salesforce, Lightning Web Componets, Node.Js, Angular 2+, Bootstrap