Salesforce Technical Hub

Wednesday, 15 February 2017

Salesforce Apex : How to get object name from record id


Below got will get the object name based on the record id in apex.

String sObjName = myId.getSObjectType().getDescribe().getName();

In above code assign record id to myId.
Posted by Daniel at 00:09
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

Daniel
View my complete profile

Blog Archive

  • ►  2020 (1)
    • ►  November (1)
  • ►  2019 (1)
    • ►  February (1)
  • ►  2018 (1)
    • ►  June (1)
  • ▼  2017 (19)
    • ►  April (4)
    • ▼  February (13)
      • jQuery code to convert table data into JSON format
      • Debug in Lightning
      • Salesforce componentRenderer.js important notes
      • Salesforce Lightning Components Important Points
      • Salesforce lightning exception handling
      • Salesforce Apex : How to get object name from reco...
      • Salesforce Lightning How to display error message ...
      • Salesforce Lightning Show Toast Message
      • Salesforce Lightning Modal Container
      • Salesforce Lightning Use of aura:if
      • Retrieve All Picklist Values for specifid fields t...
      • APEX Get Record Type Details for specific object b...
      • Convert Salesforce object returned from Apex contr...
    • ►  January (2)
  • ►  2016 (6)
    • ►  December (1)
    • ►  November (5)
Simple theme. Powered by Blogger.