
new_sampleoptionset = 100000000
new_sampleoptionsetname = hello community
Using XrmToolBox when querying an option set field you can also query same field with "name" appended and see the labels/names. When was this added in Dynamics and how can we use from API?
Hi Shawn,
You can use @OData.Community.Display.V1.FormattedValue to get label of option set Field.
Xrm.WebApi.online.retrieveRecord("account", "49ca755a-bcdf-eb11-bacb-0022480944e8", "?$select=new_serviceplan").then(
function success(result) {
var new_serviceplan = result["new_serviceplan"];
var new_serviceplan_formatted = result["new_serviceplan@OData.Community.Display.V1.FormattedValue"];
},
function(error) {
Xrm.Utility.alertDialog(error.message);
}
);
Test in CRM Rest Builder:
CRM REST Builder:
Download page: https://github.com/jlattimer/CRMRESTBuilder