Dynamics CRM & .NET (C#) Set field value for all rows

152 views Asked by At

With the help of the OrganizationService, I want to give the value of a particular column the same value for each row in a table (with a condition). How do I do that all at once?

This is how I should do it in SQL:

UPDATE [XXX]
SET Status = "Draft"
WHERE parentId = 1
2

There are 2 answers

0
Arun Vinoth-Precog Tech - MVP On BEST ANSWER

There’s no equivalent CRM SDK code to do it like your sample SQL. Because each CRM record update has to go through either service.Update() method or UpdateRequest.

Refer this SO thread for execution of bulk requests using ExecuteMultipleRequest

0
Vahid Samimi On

This is not an official way but you can set status or other optionset field with numbers in sql. If you want to see the value of options set you must go to dynamics crm customization and see that.