Hi, I am trying to return optionset text by OData query in C#, it always returns the value, how can I get the text?
*This post is locked for comments
Hi, I am trying to return optionset text by OData query in C#, it always returns the value, how can I get the text?
*This post is locked for comments
Hi partner,
You could refer to this request header according to SDK.
GET [Organization URI]/api/data/v9.0/EntityDefinitions(LogicalName='account')/Attributes(5967e7cc-afbb-4c10-bf7e-e7ef430c52be)/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet HTTP/1.1 Accept: application/json Content-Type: application/json; charset=utf-8 OData-MaxVersion: 4.0 OData-Version: 4.0
Hope it helps.
Best Regards
Leo
Have you started writing the code? Show your code. Js or c# or php or java - when you want something from web api request you have to set the header.
Use odata.include-annotations header for your purpose.
Is that only for javascript?
no way to do it through web api?
You can query the metadata to pull the label for picklist value: nishantrana.me/.../sample-code-to-get-label-and-value-for-optionset-in-crm
Read my answer in SO for enumerator concept: stackoverflow.com/.../7920473
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156