Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Access variable from retrieveMultipleRecords().then and use it outside the function

$
0
0

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(

                                  functionsuccess(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);
                                      // end resultat
                                  }
                                );


////I want to use the variable 'json' here please how can I do that

Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images