Scenario:- I am trying to retrieve the data using CRM Rest Builder for Two Fields TypeOf "1) Look-Up(Account Manager) and 2) PickList(Account Status)".
How could i display the Red Colored field value in a HTML Page?
When i am going to display them in a html page then these fields are return the following and i want to display the Red Colored Field value but it
shows the Blue Colored Field Value:-
1) Account Manager(Look-Up)
_new_accountmanager_value@OData.Community.Display.V1.FormattedValue:"Nick Salamone",
_new_accountmanager_value@Microsoft.Dynamics.CRM.lookuplogicalname:"systemuser",
_new_accountmanager_value:"21c5bf54-0359-464b-9cb9-9a2af4783201",
2) Account Status(PickList)
new_accountstatus@OData.Community.Display.V1.FormattedValue:"COD - Loaners",
new_accountstatus:100000005,
Code:-
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/accounts()?$select=_new_accountmanager_value,new_accountstatus", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
req.onreadystatechange = function() {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var result = JSON.parse(this.response);
var _new_accountmanager_value = result["_new_accountmanager_value"];
var _new_accountmanager_value_formatted = result["_new_accountmanager_value@OData.Community.Display.V1.FormattedValue"];
var _new_accountmanager_value_lookuplogicalname = result["_new_accountmanager_value@Microsoft.Dynamics.CRM.lookuplogicalname"];
var new_accountstatus = result["new_accountstatus"];
var new_accountstatus_formatted = result["new_accountstatus@OData.Community.Display.V1.FormattedValue"];
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
*This post is locked for comments
I have the same question (0)


Report
All responses (
Answers (