Hi,
I met some problem in retrieving my table of options, I have a customize solution with a web resource and some option set.
I would like to retrieve from the option set, a table of option without having to add the option set into my form.
I know how to pass my parameter in my web resource to retrieve the Name of the option set (tit_continents).
But my WEB API is not doing what I would like.
Does anybody know what I am doing wrong ?
//Get client context
var context = window.parent.Xrm.Page.context;
var clientURL = context.getClientUrl();
console.log("clientURL", clientURL);
//Will contain the result of the optionSet
var tableOptions;
var req = new XMLHttpRequest
req.open ("GET", encodeURI(clientURL + "/api/data/v8.2/GlobalOptionSetDefinitions(Name='tit_continents_test')"), true);
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.onreadystatechange == function (){
if (this.readyState == 4 /* complete*/ ) {
req.onreadystatechange = null;
if (this.status == 200) {
tableauOptions = JSON.parse(this.responseText);
}
else {
var error = JSON.parse(this.response).error;
}
}
};
req.send()
console.log("TableOptions", tableOptions.Options);
Thank you for your help
*This post is locked for comments
I have the same question (0)