A Tip A Day #39 – Easily Find Newly Created Fields in Salesforce

This post is a part of the daily blog series 

A Tip A Day, daily dosage of learning!


Day #39 – Easily Find Newly Created Fields

Finding the CreatedDate of fields in Lightning Experience is hard work.  The fields list in object manager doesn’t have a column for ‘Created Date’.  You need to manually click each and every field to know what’s the created date.

Screenshot 2021-01-28 at 9.54.25 PM

Good luck if you want to find what new fields were created this week or this month or even this quarter.

If you don’t want to go through that manual clicking process, then you are at right place.  Here’s a quick and easier way to find the list of newly created fields.

Open your Developer Console, click on the Query Editor tab, click the “Use Tooling API” checkbox, then copy the below query!

tooling api developer console custom fields created date sfdcfanboy

Here’s the basic query to start with.  Fields created TODAY:

SELECT DeveloperName, TableEnumOrId FROM CustomField 
WHERE CreatedDate = TODAY

And the result show the custom fields:

  • DeveloperName is the field name.
  • TableEnumOrId is the ObjectName/ ObjectId.
    • For standard objects, the TableEnumOrId gives the Name of the object directly like Account, Contact, Opportunity etc.
    • For custom objects, it gives the Object ID.

Screenshot 2021-01-25 at 6.55.41 PM

If you want to fetch from a single object, you can also filter by TableEnumOrId:

Standard Object

SELECT DeveloperName, TableEnumOrId FROM CustomField 
WHERE CreatedDate = TODAY AND TableEnumOrId = 'Account'

Custom Object

SELECT DeveloperName, TableEnumOrId FROM CustomField 
WHERE CreatedDate = TODAY AND TableEnumOrId = '01I...'

WHere 01I… is the Id of the custom object, which you can get from the following query or if you open the Object in Object Manager in Salesforce, you’ll see the ID in the URL:

SELECT Id, DeveloperName FROM CustomObject 
WHERE DeveloperName = 'CustomObj'

Note that DeveloperName in the Tooling API never uses __c.

You may also use different filters in the WHERE condition like last_week, last_month, last_quarter, last_year etc.

last_week

Screenshot 2021-01-25 at 6.55.41 PM

last_month

Screenshot 2021-01-25 at 6.56.03 PM


Read all other tips of the blog series here – A Tip A Day, daily dosage of learning!


Enter your email address to subscribe to this blog and receive notifications of new posts by email.

2 Replies to “A Tip A Day #39 – Easily Find Newly Created Fields in Salesforce”

  1. Tried you tip and got the following error message

    DeveloperName, TableEnumOrId FROM CustomField
    ^
    ERROR at Row:1:Column:42
    sObject type ‘CustomField’ is not supported. If you are attempting to use a custom object, be sure to append the ‘__c’ after the entity name. Please reference your WSDL or the describe call for the appropriate names.

    Liked by 1 person

    1. You need to select the checkbox “Use Tooling API” in the Developer console ‘Query Editor’ tab. Otherwise, it will give an error. I did mention this. Added the screenshot now.

      Like

Leave a comment