function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anil Kumar 136Anil Kumar 136 

Metadata query

Hi All,

I want to query newly created fields(Metadata) in the contact object where day== Today(). This possible in salesforce. Please assist.

Thanks,
Anil Kumar 
Best Answer chosen by Anil Kumar 136
Shruti SShruti S
You can use Tooling API for querying the Metadata. Here are the steps to get this done - 
  1. Go to Workbench
  2. After logging in, select REST Explorer from the Utilities menu in top right corner -User-added image
  3. And then enter the below lines in the search bar and click on 'Execute' button -
    /services/data/v39.0/tooling/query?q=SELECT DeveloperName FROM FieldDefinition WHERE EntityDefinition.DeveloperName = 'Contact' AND LastModifiedDate = TODAY
  4. You will get the list of fields created today - 
    User-added image
If you have any more queries, feel free to contact me.

All Answers

Shruti SShruti S
You can use Tooling API for querying the Metadata. Here are the steps to get this done - 
  1. Go to Workbench
  2. After logging in, select REST Explorer from the Utilities menu in top right corner -User-added image
  3. And then enter the below lines in the search bar and click on 'Execute' button -
    /services/data/v39.0/tooling/query?q=SELECT DeveloperName FROM FieldDefinition WHERE EntityDefinition.DeveloperName = 'Contact' AND LastModifiedDate = TODAY
  4. You will get the list of fields created today - 
    User-added image
If you have any more queries, feel free to contact me.
This was selected as the best answer
Anil Kumar 136Anil Kumar 136
I am able to get field names. Thanks lot for your help :)