Tuesday, 25 October 2016

Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM 2016 Web API

Before Alternate key concept was introduced in Dynamics CRM it used to be the only GUID of the record which was used to retrieve, update or delete any record. Hence we had to get the record GUID first for any retrieve, update or delete operation. But with the introduction of Alternate keys concept this overhead of getting record GUID went away as we got an alternative way to create any field as Alternate Key and use it. Let’s see how we can perform these operations using Web API now with the help of Alternate keys.
Delete operation in Web API using Alternate key:
In above operation “accountnumber” is Alternate key using which we have performed delete operation.
Update operation in Web API using Alternate key:
In above operation “emailaddress1” is Alternate key using which we have performed update operation.
Retrieve operation in Web API using Alternate key:
In above operation “mobilephone” is Alternate key using which we have performed retrieve operation.
In this way Alternate keys concept can be used for different operations like to retrieve, update, or delete any record.