Hi All, Here I am going to retrieve an Attribute Data using MetaData Service In CRM 2011
RetrieveAttributeRequest retrieveAttributeRequest = new
RetrieveAttributeRequest
{
EntityLogicalName = entityName,
LogicalName = attributeName,
RetrieveAsIfPublished = true
};
// Execute the request.
RetrieveAttributeResponse retrieveAttributeResponse = (RetrieveAttributeResponse)service.Execute(retrieveAttributeRequest);
// Access the retrieved attribute.
PicklistAttributeMetadata retrievedPicklistAttributeMetadata = (PicklistAttributeMetadata)retrieveAttributeResponse.AttributeMetadata;
OptionMetadata[] optionList = retrievedPicklistAttributeMetadata.OptionSet.Options.ToArray();
foreach (OptionMetadata option in optionList)
{
if (option.Value == selectedValue)
{
selectedOptionLabel = option.Label.UserLocalizedLabel.Label;
break;
}
}
I need java script code to retrive attributes of an entity
ReplyDelete