Advertisement
Stingerwasp

Get object name with id only

Mar 28th, 2023
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.15 KB | Source Code | 0 0
  1. Id myId = '005XXXXXXXXXXXX'; //replace with the ID you have
  2. String objectName = myId.getSObjectType().getDescribe().getName();
  3. System.debug(objectName);
  4.  
Tags: salesforce
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement