This articles explains why you'll sometimes see incorrect information in the Changed on and Changed by fields displayed in the Gearset results table or in your 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 metadata API causes incorrect info to be returned

What 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 updates.

A bug in the metadata API

In some cases, the Changed on date will display the time of the comparison, and the Changed by field will display the username of the Salesforce user running the comparison. In both cases, this information is likely to be incorrect. This is not a bug in Gearset, but unfortunately a limitation of the Salesforce metadata API.

Changed on dates are carried over in org refreshes

The most common example of the Changed on information being incorrect is following a refresh of a sandbox from another org.

When you refresh an org through Salesforce, changes in the source org are moved over to the target org to bring them back in sync. 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.

Let's take an example to show how this works:

  • Let's say you created a Custom Object in your production org on the 15th August 2018
  • When you log into the org, or run a comparison with Gearset, you can see the Changed on date is 15th August 2018
  • On the 10th September 2018 you use this production org to refresh your integration sandbox
  • This refresh adds this new custom object to your sandbox
  • When you log into the sandbox, or run a comparison against it in Gearset, you'll see that the Changed on date for this object is still the 15th August; it is not the 10th September

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 metadata API that means that 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 type.

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

Below is an example workflow being queried using workbench. You can see that Salesforce returns the current time for both Change and Created date, and not the actual times you'll see if you log into the Salesforce UI.

This retrieval was run on the 31st August 2018 at 9:39am. As you can see below, that is also the information returned by the API for this workflow.

Unfortunately, there is no workaround for this bug. It is a known issue with Salesforce, but we don't have any definite timeframes for if or when this will be fixed.

If you want to confirm the changed on and by date 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 these changes in a change monitor job in Gearset

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

For example, if you had a change monitoring job running against a sandbox which is subsequently refreshed from production, the next snapshot after your sandbox refresh will track any changes as differences.

When you look at the results of the job, you may see that the Changed on dates for your differences are outside of the date the snapshot was taken.

This can initially be confusing, but hopefully this article explains why you may see these changes and what the cause of them is.

Did this answer your question?