Alex Gordon
Alex Gordon

Reputation: 60731

How to implement RetrieveAttributeRequest via Odata?

In order to get OptionSet information, we can issue a request:

// Create the request
RetrieveAttributeRequest attributeRequest = new RetrieveAttributeRequest
{
    EntityLogicalName = Contact.EntityLogicalName,
    LogicalName = "new_string",
    RetrieveAsIfPublished = false
};

// Execute the request
RetrieveAttributeResponse attributeResponse =
    (RetrieveAttributeResponse)_serviceProxy.Execute(attributeRequest);

Console.WriteLine("Retrieved the attribute {0}.",
    attributeResponse.AttributeMetadata.SchemaName);

Is there a way to do this using an Odata request in crm 2016?

Upvotes: 2

Views: 755

Answers (1)

James Wood
James Wood

Reputation: 17562

Yes you can, Use the Web API with Dynamics 365 metadata.

I suggest you look at the OptionSetMetadata, found at [Organization URI]/api/data/v8.2/GlobalOptionSetDefinitions

Upvotes: 2

Related Questions