Can we override the CreatedOn date in Dynamics 365 CE?

I was looking at some solutions for migrating data from external sources into dynamics and found was blocked by a particular record time-stamp requirement.

In the particular scenario the records had to be migrated but each line should keep its original CreatedOn time-stamp.

Looking at the SDK and the crmsvcutil I saw that the CreatedOn field was read-only. This meant that the attribute did not accept changes.

After some research, I found that CRM entities also have an additional datatime field called : OverriddenCreatedOn (Record Created On).

The way this field works is very trick. Essentially once you set its value, the SDK updates the CreatedOn field and re-stamp the OverriddenCreatedOn with the operation time-stamp.

For example:

  • Let's say that your original CreatedOn date is "2017-10-12 10:00am".
  • Once you set the OverriddenCreatedOn to "2017-10-12 10:00am".
  • The SDK will take the value, place it into the CreatedOn field and it will time-stamp the OverriddenCreatedOn with the operation's current date and time.

I hope this helps you on your next migration or integration project.

Add comment