How to update a CRM 2011 Entity using LINQ in a Plugin?

后端 未结 3 851
难免孤独
难免孤独 2021-01-11 15:52

We are able to create new entities without any issues, but updating an existing entity in a plugin this does not appear to be working. This is for CRM 2011.



        
3条回答
  •  盖世英雄少女心
    2021-01-11 16:18

    You have to mark the object as modified in order to get it submitted to the server. See OrganizationServiceContext.UpdateObject (Entity)

    You should add crmContext.UpdateObject(contact); before crmContext.SaveChanges();

提交回复
热议问题