Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

C# Retrieve Attributes Metadata with DisplayLabel

$
0
0

Hi experts,

I'ma facing some issue while trying to retrieve all attributes metadata. I would like to get all the attributes and their metadata for a specific entity (account for example). The first thing to do is a RetrieveEntityRequest like this:

var eMetadataRequest = new RetrieveEntityRequest { EntityFilters = EntityFilters.Attributes, LogicalName = "account" };
var eMetadataResponse = (RetrieveEntityResponse)crmService.Execute(eMetadataRequest);
var accountMetadata = eMetadataResponse.EntityMetadata;

But, the display name for many attributes are null on the result (while they're not in CRM)

accountMetadata.Attributes[0].DisplayName.UserLocalizedLabel


I know that there is a request of type RetrieveAttributeMetadata (that returns display name also)

var attReq = new RetrieveAttributeRequest { EntityLogicalName = "account", LogicalName = "preferredcontactmethodcode"  };
var attRes = (RetrieveAttributeResponse)Service.Execute(attReq);


But I would not write a loop for all attributes retrieved on the first request to get displayName...

There is a parameter I missing on the first request? Or any other solution?

I would just like to point out that I have only one language installed on CRM


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>