Home

Aug 4, 2008

CRM 3.0 AttributeMetadata to CRM 4.0 RetrieveAttributeResponse

Hi All,

I found the post on newsgroup where user asked what is the replacement for RetrieveAttributeMetadata in CRM 4.0.

Here we go.

// Create the request
RetrieveAttributeRequest attributeRequest = new RetrieveAttributeRequest();
attributeRequest.EntityLogicalName = EntityName.contact.ToString();
attributeRequest.LogicalName = "fullname";
attributeRequest.RetrieveAsIfPublished = true;
RetrieveAttributeResponse attributeResponse = (RetrieveAttributeResponse)metadataService.Execute(attributeRequest);
// Access the retrieved attribute
StringAttributeMetadata retrievedAttributeMetadata = (StringAttributeMetadata)attributeResponse.AttributeMetadata

RetrieveAttributeRequest is the replacement for RetrieveAttributeMetadata in CRM 4.0.

No comments: