Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vegard_bakke
Partner - Creator III
Partner - Creator III

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

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?

3 Replies
vegard_bakke
Partner - Creator III
Partner - Creator III
Author

For information:

I did not find a solution to this. And ended up redesigning the solution, so that I don't need to set a variable from the extension.

IF someone knows the answer on how to do this, I would still like to know how. Because I can see the potential need for setting a variable from an extension arise again. Without necessarily having to trigger a reload of the extension.

Cheers,

Vegard

AbhijitBansode
Specialist
Specialist

We are also facing the same issue.

Can you please advice which alternative solution you have designed. Any hint would be helpful. Thanks.

Not applicable

if (  window.treeData==undefined){

var treeData = DATA.children[0]

window.treeData=treeData

***

some code

***

}