asp.net - Dynamics CRM Entity Data update from a custom Aspx Page -
I have found several samples to create data in a mobility CRM from a custom ASPX page, but I want to update the unit data Any sample required would be useful.
Thanks
It is very easy, when you create a record as normal You use the following code:
unit new resource = new unit ("contact"); ["First name"] = "John"; ["Last name"] = "Smith"; Service.Create (newContact);
If you need to update a record, you need to recover it first (if you have a Guid, or RetrieveMultiple
Using recover
code> if you need to use it on a query), just after updating the field.
unit recovered contact = service. Recover ("Contact" GuidOfTheRecord, Column YouWantToRetrieve); Recovered contact ["first name"] = "my new first name"; Recover Contacts ["Last Name"] = "My New Last Name"; Service.Update (retrievedContact);
Comments
Post a Comment