I am using the following code to get the object type in ms dynamics CRM 2013 and 2015, in CRM 2015 Update 1 the code is not working?
function GetObjectTypeCode(entityName)
{
/// <summary>
/// Gets the EntityTypeCode / ObjectTypeCode of a entity
/// </summary>
/// <param name="entityName" type="string">
/// Name of entity to return object type code of
/// </param>
/// <returns type="int" />
var lookupService = new RemoteCommand("LookupService","RetrieveTypeCode");
lookupService.SetParameter("entityName", entityName);
var result = lookupService.Execute();
if (result.Success && typeof result.ReturnValue == "number")
{
return result.ReturnValue;
}
else
{
return null;
}
}
*This post is locked for comments