Hi All,
I all prior to introduction new Client API for D365 v9,
request.setRequestHeader("Prefer", "odata.include-annotations=OData.Community.Display.V1.FormattedValue");
was used to include Formatted Values.
How can I use Xrm.WebApi.retrieveRecord so that it returns the FormattedValues as well.
Example,
I am calling the below code
Xrm.WebApi.retrieveRequest("new_title","C859A265-6262-E811-A970-000D3A18032D","?$select=new_name,new_titletype").then( function success(result) { var titletype= result["new_titletype@OData.Community.Display.V1.FormattedValue"]; // perform operations on record retrieval }, function (error) { console.log(error.message); // handle error conditions });
Here, new_titletype is an optionset attribute. Let us say for this example , it is equal to, Value:864560002 Label: "Standard"
Now, Upon Execution of above, result["new_titletype@OData.Community.Display.V1.FormattedValue"] returns undefined instead of "Standard".
Kindly assist.
Regards,
Siddharth
*This post is locked for comments