Hi All,
Please find the below script to get Entity Type code in c#
Int getvalue = GetEntityTypeCode(“account”);
private static int GetEntityTypeCode(string EntityName)
{
RetrieveEntityRequest request = new RetrieveEntityRequest();
request.LogicalName = EntityName;
RetrieveEntityResponse response = (RetrieveEntityResponse)crmService.Execute(request);
int objecttypecode = response.EntityMetadata.ObjectTypeCode.Value;
return objecttypecode;
}
{
RetrieveEntityRequest request = new RetrieveEntityRequest();
request.LogicalName = EntityName;
RetrieveEntityResponse response = (RetrieveEntityResponse)crmService.Execute(request);
int objecttypecode = response.EntityMetadata.ObjectTypeCode.Value;
return objecttypecode;
}