Gotcha Working with Dynamics CRM Web API: Grammar..

Microsoft has suggested developers to start using the new Web API to develop new custom development. As they are planning to deprecate the 2011 endpoints sometime after CRM version 9 (We are on version 8 now!). Ref: https://msdn.microsoft.com/en-us/library/dn281891.aspx

So, I’ve embraced the Web API in my new projects for javascript codes. Typically I would use CRM Rest Builder by Jason Lattimer to build Web API request in Javascript.

I found out it is quite interesting on one of my custom entity, let’s call it “cust_selectionmatrix”. I tried to build the query using the tool, but I won’t generate the query as expected. Then I tried to look at Microsoft examples around the Web API query. Most of them are appending “s” against the entity name. E.g: for account: /api/data/v8.0/accountand for contact: /api/data/v8.0/contacts.

So my first trial is just adding s at the end of my custom entity: /api/data/v8.0/cust_selectionmatrixs. However, I’ve got a weird error:

"Resource not found for the segment 'cust_selectionmatrixs'."

Then after I tried to find the list of entity for Web API using  <CRM Server URL>/api/data/v8.0/I found out that my entity is named: “cust_selectionmatrixes” in the Web API. I reckon this is how CRM is implementing “English”. So, if your entity ends with: ‑s, ‑sh, ‑ch, ‑x, or ‑z. Just append ‘es‘ to your entity name to work with the Web API.

https://www.grammarly.com/handbook/mechanics/spelling/5/spelling-plurals-with-s-es-or-other-plurals/

HTH…

 

Then.. There was an awkward moment when I have an entity named “cust_settings” and it is translated as “cust_settingses“… 15jkjv.jpg

4 thoughts on “Gotcha Working with Dynamics CRM Web API: Grammar..

Leave a comment