0

I am making a short program to update values in Dynamics CRM 2016 through the web API however, the examples from Microsoft always use the account guid such as,

PATCH [Organization URI]/api/data/v8.1/accounts(00000000-0000-0000-0000-000000000001) HTTP/1.1

The problem is that the users are already created and I don't have their GUID values.

Is it possible to update account's details based on say email address value if it's unique? Can I pass the email value instead of the GUID? If no, what would you recommended doing, something like get request for all account GUIDs and email addresses and then locally map them to create appropriate requests with guid?

Would this be relevant when we talk about big amount of accounts(in millions)?

Prabhat Sinha
  • 1,500
  • 20
  • 32
Slavi
  • 120
  • 4
  • 15

1 Answers1

2

First of all tou are using the new Web API, keep in mind that if you are developing with .NET you can use the SDK dlls, in my opinion they are easier to use.

Normally you can't use the email address instead of the record id (accountid in your case) BUT your version of Dynamics CRM (2016) supports alternate keys and eventually you can set the email field (emailaddress1) to be a key, more information here: LINK

Right now I don't have an example of alternate keys with Web API, and googling some links pointed to some issues, you need to try out by yourself

Guido Preite
  • 14,905
  • 4
  • 36
  • 65
  • This is great! Thanks, I'll get right to it :) However, if I can't get the alternative key working, what do you think is the best way to keep/maintain GUID's, performance wise especially when dealing with high amount of data? – Slavi Apr 23 '16 at 22:16
  • 1
    depends how many records you need to update, if few you can do a retrieve and update for each record, if you have more records (more than 500/1000 records) to update I suggest a caching (partial or full based on the total records inside CRM) – Guido Preite Apr 23 '16 at 22:30