I would like to get help solving a problem with this code: I'm developing a Qlik sense Extension using JavaScript. I Write the function GetCurrSelect , And I want it to run only when I call it from the paint function. But every time the program needs to run the paint function, it first run the GetCurrSelect function and even several times. I tried to add the condition if(a===1) But it did not help, the program accesses this function even without invoke it.