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 : https://blog.hompus.nl/2015/05/28/entity-type-code-using-javascript-only/
Thank you,
Sreeni Pavalla
It’s a very useful solution but… the use of Mscrm namespace is not supported by Microsoft.
Regards!
LikeLike