Tuesday, March 15, 2016

Get Entity Type code in MSCRM C#

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;
}

No comments:

Post a Comment

Built a PowerApps control that shows PDF files saved records in MSCRM/Dataverse

Please find my YouTube Video link for Built a PowerApps control that shows PDF files saved records in MSCRM/Dataverse  YouTube Link Git Hub ...