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: 
simospa
Partner - Specialist
Partner - Specialist

Assign a value to a variable in Ajax

Hi, I'm going mad trying to do this:

ActiveDocument.GetVariable("myvar").SetContent "aaaa", true

I put this in a Macro, I want to do this when I click on a button.

If I use it in desktop version, it works correctly, but if I use the in Ajax Plugin (QV Server 11) version it doesn't work.

Can someone help me?

Thanks!

Aki76

6 Replies
Miguel_Angel_Baeyens

Hi,

Use an action instead. For example, create a new button, got to its properties, Actions, External, Set Variable. So when you click on it, tha variable should get the vale specified.

Hope that helps.

Miguel

simospa
Partner - Specialist
Partner - Specialist
Author

Thanks Miguel,

but I have to use this action in a more complex script, I can't use a button directly but the assignation has to be set into a macro. It's the reload script, that doesn't assign the variable correctly and so I can't have a feedback of the end of the reload....

Aki76

Miguel_Angel_Baeyens

Hi,

I may have understood you wrong: certain macros cannot be used in the script (neither in Desktop nor in Server), because ActiveDocument is only valid when the document is actually active, meaning that after the reload, when the reload dialog has gone and you can interact with the data.

Could you please elaborate on your actual requirements?

Miguel

simospa
Partner - Specialist
Partner - Specialist
Author

but then how can I have an assignment?

I need have a feedback of the success of the reload... and the EDX Reload Script I have use this way to alert me that I finished reloading.

ActiveDocument.GetVariable("vAjaxMsg").SetContent sMsgTxt, true

then I have a textbox where I want to see sMgsTxt (Reload succesfull, failed,...)

i the line doesn't works. I need to refresh an object first? How?

There are no other method to do this?

Aki76

Miguel_Angel_Baeyens

Ok,

So you want to control when a task has been completed successfully without need to see the QMC.

One way to achieve this is to store that value into a QVD file instead if the script reached the last line all right, then have another task that reloads depending on the first (you can set task dependencies in the QMC) and shows that textbox.

Hope that helps.

Miguel

simospa
Partner - Specialist
Partner - Specialist
Author

mh good idea...

I'll try and I'll report you.

Thanks

Aki76