Easiest Way to Find Newly Created Objects and Fields in Salesforce

Advertisements

Last Updated on March 31, 2022 by Rakesh Gupta

Big Idea or Enduring Question:

  • How to find newly created or modified fields in Salesforce?

Objectives:

After reading this blog, you’ll be able to:

  • Understand Tooling API objects – CustomField and CustomObject
  • Query Tooling API objects from Developer Console 
  • Find out newly created or modified custom fields 
  • Find out newly created or modified custom objects 

Business Use case

Anita Smith is working as a Salesforce Consultant at Gurukul On Cloud (GoC). She has received a requirement from her Architect to find out custom fields and objects created in the last 365 days. 

Understand CustomObject and CustomField Tooling API Objects

While working on a cleanup project we often have a requirement to find out custom fields and custom objects created in the last n days. There are various ways to achieve it, for example:

  1. Object Manager
  2. Setup Audit Trail

We will use Tooling API objects to find out such details. It is very simple, just run a query, if needed you can able to export it. 

Let’s take a pause here, familiarize yourself with the CustomObject and CustomField Tooling API objects. It contains

Object Name
Details
CustomObject It represents a custom object that stores data unique to your organization. Includes access to the associated CustomObject object and related fields in Salesforce Metadata API.
CustomField It represents a custom field on a custom object that stores data unique to your organization. Includes access to the associated CustomField object and related fields in Salesforce Metadata API. 

Let’s begin the process.

Guided Practice (We-do): Find Newly Created Objects

To find the Custom object created in the last 365 days, we will use the Developer Console to Query the Tooling API object CustomObject.

  1. Click Setup | Developer Console 
  2. In the Query Editor, enter the following SOQL query 
    1. SELECT DeveloperName, SharingModel FROM CustomObject
      WHERE CreatedDate= LAST_N_DAYS:365
       
    2. Select the Use Tooling API checkbox.
    3. Click Execute.
  3. If you want to download the data to share with the project manager or Architect, then consider using Visual Studio Code.

Guided Practice (We-do): Find Newly Created Fields

To find the Custom fields created in the last 365 days, we will use the Developer Console to Query the Tooling API object CustomField.

  1. Click Setup | Developer Console 
  2. In the Query Editor, enter the following SOQL query 
    1. SELECT DeveloperName, TableEnumOrId, CreatedDate FROM CustomField
      WHERE CreatedDate = LAST_N_DAYS:365
    2. Select the Use Tooling API checkbox.
    3. Click Execute.
  3. If you want to download the data to share with the project manager or Architect, then consider using Visual Studio Code.

Formative Assessment:

I want to hear from you!

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

Preferred Timing(required)

4 thoughts on “Easiest Way to Find Newly Created Objects and Fields in Salesforce

  1. Thanks Rakesh, but using this query below the “DeveloperName” returns the field name column? I need both the field name AND the table name it comes from? : SELECT DeveloperName, TableEnumOrId FROM CustomField
    WHERE CreatedDate = LAST_WEEK or CreatedDate = THIS_WEEK

  2. This is great but for custom objects it only returns the long ID of the object (TableEnumOrId)
    – How do I get the actual text name of the custom object in the same query?

    1. Rakesh Gupta – Mumbai – 9x Salesforce MVP | Senior Solution Architect | 8x Author | 5x Dreamforce Speaker | Salesforce Coach | Co-host of AutomationHour.com and AppXchangeHour.Com

      DeveloperName will return custom object DeveloperName

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Automation Champion

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

Continue reading

Exit mobile version
%%footer%%