Dynamics 365 Web API get entity using alternate key value that has apostrophe/single quote in it
In Dynamics 365, you can create alternate key for an entity using one of the attributes. Entity can be retrieved using alternate key via Web API. This MSDN article gives you an example on how to do that: https://msdn.microsoft.com/en-us/library/mt607871.aspx#BKMK_UsingAltKeys I had an interesting error today when performing a query using alternate key. I tried to get an entity record from the User entity (systemusers) using an alternate key that is configured in the User entity. The alternate key uses the internalemailaddress attribute, which contains users' email addresses. A user's email address is firstname.O'lastname@domain.com, and as you can see, there is an apostrophe/single quote in the email address. When performing the query via Web API to get the user record, you can construct the below Url and simply paste into the browse to see the JSON response. In this case, the Url is: https://organization.crm6.dynamics.com/api/data/v8.2/systemusers(internalemailadd...