简体   繁体   中英

Microsoft Dynamics CRM 2011: Updating a lookup field using SQL

I have thousands of incidents in my CRM that are either resolved or cancelled. We have added a new lookup field to incident's form recently but of course incidents that are already closed do not have any value in it. It is essential to populate that lookup field for all incidents.

I tried to create a console application that would have updated all closed incidents but apparently I can't update an incident unless I activate it first.

Reopening (and then closing again) any incident at this point is pretty much not wanted solution.

So I was wondering updating that lookup field by writing simple SQL statement. I know this is highly unsupported so my question is what could possible go wrong? I tried to update one incident by using SQL and it seems to work but before I update all of them I want to know why I should no do this? Is it enough to update that one lookup field in a database table (to put relevant GUID into it) or is there something else I should update too?

Or if you have any other solutions how I could populate that field without reopening an incident I'd be happy to hear it.

As you already found by SDK you need to reactivate the incident first.

By SQL is unsupported and is preferable to avoid direct updates.

You can face some issues with the SQL way, for example workflows will not be triggered by SQL updates, in your case probably you will not face issues updating closed incidents (probably you need this lookup filled for reporting requirements).

As far as I know if you want to go with SQL you need to update only the single attribute.

Up to you the final decision.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM