Skip to main content

Why is the 'Changed on' or 'Changed by' sometimes incorrect?

Understanding why some metadata have incorrect 'Changed on' and 'Changed by' information

Valerio Chang avatar
Written by Valerio Chang
Updated over a week ago

This article explains why you'll sometimes see incorrect information in the Changed on and Changed by fields displayed in the comparison results table or in your org change monitoring results.

Why is the 'Changed on' information wrong?

There are two main reasons for incorrect Changed on information:

  • Not all actions update the Changed on date for metadata.

  • A bug in the Salesforce Metadata API causes incorrect info to be returned.

Which actions modify a 'Changed on' date

Changed on dates for metadata in Salesforce are updated when users make manual changes to an item. They are not updated by automated processes such as sandbox refreshes or platform releases (both discussed in further detail below).

A bug in the Metadata API

In some cases, you might notice the Changed on date showing the time of the comparison, and Changed by displaying the username of the user running it. This is not a Gearset issue, but a limitation of Salesforce’s Metadata API.

This bug commonly affects metadata types like workflow rules and custom objects. Salesforce may return the current time and user instead of the true last modified data. For example, querying a workflow via Workbench may show the current timestamp as both lastModifiedDate and createdDate, even if the item hasn’t recently changed.

'Changed on' dates are carried over in org refreshes

The most common case of misleading Changed on date is after a sandbox refresh. When you refresh a sandbox from another org (e.g. from production), metadata is copied across, but Salesforce does not update the Changed on date.

Example:

  • A custom object is created in production on 15 August 2019.

  • You refresh your integration sandbox from production on 10 September 2019.

  • In the refreshed sandbox, the object still shows Changed on: 15 August 2019, even though it was just added.

    This is expected behavior from Salesforce.. This process works differently to a normal deployment in Salesforce. When an org is refreshed like this, Salesforce does not update the Changed on information for any components that are moved.

Platform releases adding new features

The other main cause of erroneous Changed on is Salesforce platform releases (e.g. Summer '18 > Winter '19). If a platform release introduces new features or modifies metadata, this will not affect their Changed on information.

For example, the org below has been updated from Summer '18 (v43) to Winter '19 (v44) of the Metadata API. As a result, several objects have been changed, but their Changed on dates are still showing the date those objects were manually edited by users in the org.

A bug in the Metadata API

There is a bug in the Salesforce Metadata API that means sometimes Salesforce returns incorrect Changed on information for an item. This bug can affect a range of different items, but is most commonly seen in the workflow and custom object metadata types.

In fact, if you have access to Workbench, you can try this yourself. 

Below is an example workflow being queried using Workbench. This retrieval was run on the 31st August 2018 at 9:39 am. You can see that Salesforce returns the current time for both lastModifiedDate and createdDate, and not the actual times you'll see if you log into the Salesforce UI.

Unfortunately, there is no workaround for this bug.

If you want to confirm the Changed on and Changed by for any item, you can log into the Salesforce org in question and check in the UI, although this will still be subject to the provisions mentioned above about what alters the date.

Understanding unexpected changes in change monitoring jobs

Understanding what causes the Changed on information to be updated explains why you may sometimes see unexpected results in an org change monitoring job in Gearset.

For example, If a monitored sandbox is refreshed from another environment, the next snapshot will show changes even though the Changed on values may still reflect the source org's original data. This can make it seem like changes happened earlier or later than they actually did.

While this can be confusing, it’s a result of how Salesforce handles metadata during org refreshes and API responses. Gearset continues to monitor and surface metadata changes as accurately as possible within these constraints.

Did this answer your question?