Retrieve CustomField Metadata Information Using Tooling API

Salesforce users can identify custom fields created in a specific time frame using the Salesforce Tooling API. This can be accessed through the developer console by checking "Use Tooling API". As well as field info, the API provides metadata about objects, standard and custom properties, code coverage, validation and workflow rules. The data can be exported in CSV format using an extension called 'SFDC Dev Console Data Exporter'.

Sometimes Salesforce admin/user needs to know which custom fields created in a certain time frame like THIS Week/Month/Year, etc.

We can use Salesforce Tooling API to get the Custom Field information. We can query the Custom Field metadata information inside Salesforce developer console, you just need to check the “Use Tooling API” checkbox. Below is the screenshot showing the lists of custom fields created this year.

Query: SELECT DeveloperName,CreatedDate,TableEnumOrId FROM CustomField where CreatedDate = THIS_YEAR

Q. How to export the data showing in dev console in CSV format?

Ans~ We can use the ‘SDFC Dev Console Data Exporter‘ google chrome extension for that.

SFDC Dev Console Data Exporter (Screenshot)

2

Q. What is the Tooling API?

Ans~ Tooling API exposes metadata information of Org, we can access Metadata information using REST or SOAP. Tooling API retrieve the small piece of metadata, we can use this to develop an interactive application or tools for developers.

We can accomplish the following tasks using the Tooling API:

  • Retrieve metadata about an object’s field.
  • Retrieve metadata of custom and standard object properties.
  • Get metadata information about Apex Classes, Visualforce Pages, Apex Triggers.
  • Get Code coverage details of Apex classes and Trigger.
  • Retrieve metadata information about ValidationRule and WorkflowRules.
  • Query RecentItems used in your SFDC org.
  • Etc…

References:

https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_customfield.htm

Arun Kumar
Arun Kumar

Arun Kumar is a Salesforce Certified Platform Developer I with over 7+ years of experience working on the Salesforce platform. He specializes in developing custom applications, integrations, and reports to help customers streamline their business processes. Arun is passionate about helping businesses leverage the power of Salesforce to achieve their goals.

Articles: 162

Leave a Reply

Discover more from SFDC Lessons

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from SFDC Lessons

Subscribe now to keep reading and get access to the full archive.

Continue reading