cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

display the value of a global variable in a popup window during the execution of a loop

FirozeS
Newcomer
0 Likes
221

I need to display the value of a global variable in a popup window, which works fine when the popup is shown before the loop("POPUP_WOKING" file attached), but I want to display it during the loop's execution."

Code before loop

 

var CUSTID = PlanningModel_1.getMembers("ZZ_SAC_DIM_GL_CST");
console.log(CUSTID);
 
COUNT=5000;
Popup.open();
 
When I call the popup window in the middle of the for loop, it opens the window but does not show the 'COUNT' variable, which I have declared as COUNT = i;
where "i" value recorded to COUNT and it need to show in popup

Code call pop in middle of the loop


var CUSTID = PlanningModel_1.getMembers("ZZ_SAC_DIM_GL_CST"); /
var dimensionId = "ZZ_SAC_DIM_GL_CST";
debugger;
console.log(CUSTID);
//COUNT=5000;
//Popup.open();
for (var i=0;i<CUSTID.length;i++)
{      
 
if(i===30||i===60||i===90||i===110||i===140||i===170||i===200)
{
COUNT===i;
 
  Popup.open();
         
};
 
};
 
 POP_WORKING.png

POPUP_NOT_WORKING.png

 

Accepted Solutions (0)

Answers (1)

Answers (1)

AbdullahShaffi
Explorer
0 Likes

As per your code, Global variable gets updated based on count in the loop. 
However, your Application/Widget (Front end view) is not refreshed to display the updated value in Global variable.
In my opinion, if you refresh for every count, it will impact the performance.