简体   繁体   中英

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

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

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

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.

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