This article explains why you'll sometimes see incorrect information in the
Changed on and
Changed by fields displayed in the Gearset metadata 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 ondate 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, 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. (This is discussed in further detail later on in this article.)
'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 2019.
When you log into the org, or run a comparison with Gearset, you can see the
Changed ondate is 15th August 2019.
On the 10th September 2019 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 ondate 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 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
createdDate, and not the actual times you'll see if you log into the Salesforce UI.
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
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 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 an org change monitoring job in Gearset.
For example, if you had a change monitoring job running against a sandbox that 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.