Description: We have Salesforce recordId but need to identify what is the type of Subject corresponding to this record id.
Solution: We can get Sobject name from recordId with getSobjectType() function, sample code below:
Apex Code:
public void echoSObjectName(String RecID) { objName = RecID.getSobjectType(); System.debug('Object Name is ' + objName); }