How do I get the Id of the field on Standard object like Account, Opportunity from Apex? Tooling API helps in getting the Custom Object and Custom Field Id.

Any idea?

1 Answer 1


The standard salesforce fields have their own standard IDs (names). Here is the list

  • What if I add a custom field on standard object.. I added a custom field and it's Id is 15 character alphanumeric. Right now I have to store the ID of the field in custom setting which is not a elegant solution as the Id will differ between environments. Hence wanted to retrieve the IDs dynamically in code.
    – get2arpit
    Dec 4, 2014 at 4:14
  • Unfortunately the tooling API doesn't support that scenario at the moment. You can do that with this old hack (if that helps) - force201.wordpress.com/2014/02/27/finding-visualforce-field-ids Dec 4, 2014 at 4:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .