Hello I'm using retrieveMultipleRecords to get some records from another table I'm using the data I'm getting and putting it into a variable I want to access that variable outside of the retrieveMultipleRecords function but I cant
this is my js code
window.parent.Xrm.WebApi.retrieveMultipleRecords("zs_resultat", fetchXMLResultats).then(
function success(resultresultats) {
for (var q = 0; q < resultresultats.entities.length; q++){
json+=' {\n "level":'+resultresultats.entities[q].zs_numero+',\n'
json+=' "min":'+resultresultats.entities[q].zs_bornemin+',\n'
json+=' "max":'+resultresultats.entities[q].zs_bornemax+',\n'
json+=' "label": {\n'+resultresultats.entities[q].zs_jsonlabelresultat+'\n },'
json+=' "description": {\n'+resultresultats.entities[q].zs_jsondescresultat+'\n },\n }'
if(resultresultats.entities.length-q>1){
json+=','
}
}
},
function (error) {
console.log(error.message);
}
);