Month: February 2016

Common Error – Bad request when using Web API CRM 2016

Hi, I have come across an error while using web API, I was trying to retrieve and update values from one of entities.   Below is the API request. var id =; var entity = {}; entity.statecode = 1; entity.statuscode = 2; var req = new XMLHttpRequest();“PATCH”, Xrm.Page.context.getClientUrl() + “/api/data/v8.0/quotes(” + id +

Continue reading

Get Entity Type Code by Name from Javascript – CRM 2015/2016

Hi, There is a very easy way to get Entity Type Code by Name like below var entityTypeCode = Mscrm.EntityPropUtil.EntityTypeName2CodeMap[“lead”];   this will be really helpful when you try opening a CRM form or window. I have tested this in both CRM 2015 and 2016 which worked as charm. Credits to : Thank you, Sreeni Pavalla