3 Replies Latest reply: Sep 10, 2015 6:47 AM by Sergey Sukhorukov RSS

    How to avoid doc.SetVariable() triggering a reload of the extension?

    Vegard Bakke

      From within an extension, I try setting a variable. But the variable is casing the whole extension to reload, and run the Qva.AddExtension() again... and again... and again...

       

      The extension is fetching a value form a database; upon load, and on certain user actions. I need to transfer this value back to the QlikView document. And the plan was to set a variable.

       

       

      this.setAccountVariable = function(accountNumber)

      {

          var variableName = _self.qlikViewPage.Layout.Text0.text;

          var doc = Qv.GetCurrentDocument();

          doc.SetVariable(variableName, accountNumber);  // If I comment this line, it "works"

      }

       

       

      As long as the SetVariable() is there, the extension keeps reloading forever.

      If I comment that line, the extension "works", except of course, it doesn't set the variable that I need it to set.

       

       

      Any suggestions to how to get out of this problem, please?