Play Games

Search This Blog

Saturday, August 7, 2021

How to get objectName from record Id in apex salesforce - Salesforce Globe For You

 How to get objectName from record Id in apex salesforce  - Salesforce Globe For You 

Solution:

Id recordId = '00Q0o00001fxEZiEAM';

Schema.SObjectType sobjectType = recordId.getSObjectType();

String sobjectName = sobjectType.getDescribe().getName();

system.debug('Object Name : '+sobjectName);

Output:




No comments:

Post a Comment