Hello, I need to make one Dynamic OptionSet for states of my country from a Json with JavaScript, but I do not know how can add the new items into my OptionSet.
My JavaScript's code is this:
function CargarEstados(){
var xhr = new XMLHttpRequest();
xhr.open('GET', "innovacionesrom3.crm.dynamics.com/.../bln_estados.js", true);
xhr.send();
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var response = JSON.parse(xhr.response),
i = 0;
for(i; i < response.length; i++) {
console.log(response[i]);
Xrm.Page.getControl("bln_estadodinamico").addOption(response[i].name, response[i].id);
}
}
};
}
The Json is work but does not add the new items.
*This post is locked for comments
I have the same question (0)