Read-only columns in Dynamics365 driver

Discussion of open issues, suggestions and bugs regarding usage of ODBC Drivers
Post Reply
azKevin
Posts: 2
Joined: Wed 04 Sep 2019 15:14

Read-only columns in Dynamics365 driver

Post by azKevin » Wed 04 Sep 2019 15:24

Hi,
I'm doing an evaluation of the Dynamics 365 driver and up to now it's been really good, thanks.
I'm doing a large scale migration from an on-prem 2011 server up to 365 in the cloud.
I've come across what will be a shop stopper for me if it can't be fixed/worked around. I'm trying to update the modifiedon column in a table (contact) and I get the error message:

SQL error: [Devart][ODBC][Dynamics CRM]Column 'modifiedon' is read-only and cannot be used in the 'UPDATE' statement, SQL state S1000 in SQLExecDirect

Which is fine as it maintains the audit trail, but I need to change it. There are some 3rd party tools which claim to maintain this time stamp and I presume they are using the same underlying API as you are.
So my question to you is , is this a behaviour a run-time thing that can have an option set somewhere to override it or is the way it works and can not be changed?
thanks in advance
Kevin

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Read-only columns in Dynamics365 driver

Post by MaximG » Fri 06 Sep 2019 14:33

Official documentation https://docs.microsoft.com/en-us/dynami ... ce-odata-9 confirms that the "modifiedon" field is "Read Only" - we are not able to impact this behavior. You can contact Dynamics 365 support team to request an option to change such fields.

azKevin
Posts: 2
Joined: Wed 04 Sep 2019 15:14

Re: Read-only columns in Dynamics365 driver

Post by azKevin » Mon 09 Sep 2019 14:36

Hi Thanks for that, yes seems there are four fields you can't impact (date created and modified & username who created and modified the record), as the wntire thing is view based there are other read-only fields as well.
looks like you have to write a plugin to manipulate these fields at the correct point in the pipeline, for anyone who faces the same issue this link https://debajmecrm.com/2019/05/12/creat ... amics-365/ and https://community.dynamics.com/365/b/le ... dby-fields explains it all.
Thanks again for looking

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Read-only columns in Dynamics365 driver

Post by MaximG » Wed 11 Sep 2019 15:59

We'll investigate the possibilities of implementing the requested behavior.

Post Reply