Search code examples
javascriptasp.net-web-apiodatadynamics-crmdynamics-crm-2016

Microsoft Dynamics CRM - What is the OData url format to retrieve label of two option set attributes of an entity?


The following Odata url retrieves attributes of an entity.

http:// < host_name>/< org_name>/api/data/v8.1/EntityDefinitions(70816501-EDB9-4740-A16C-6A5EFBC05D84)/Attributes

The entity has few TwoOptionSet attributes. I want to retrieve the label for TrueOption and FalseOption. In the database, these values are stored in StringMapBase table.

How do I construct the OData query to retrieve these labels? Can you please guide me?

Thanks, Vanathi


Solution

  • OData cannot be used to retrieve metadata. You need to use a SOAP request instead. However, when you are on Dynamics CRM 2016 you can use the Web API since it supports metadata queries.

    For Dynamics 365/CRM 2016 you can find detailed information on getting attribute metadata using the Web API here.