Qlik Community

QlikView Management

Discussion Board for collaboration on QlikView Management.

Not applicable

Differentiate desktop client reload and task reload in the script

In the script, knowing if the reload was started from the desktop client or by a publish task would be very beneficial for me. I figured out one way to do this which is almost what I needed, but wanted to ask you for other possible ideas.

What I came up with was to add a parameter to the task "FullLoad" and it gets only one value from the task. If this variable does not exist in the document, it is being created and I can reference to that and it's all good, BUT the QMC shows a warning because the variable did not exist and was created. If I create the variable in the document to avoid this warning, the variable value is not being changed when executing the script, so that's no good either.

Ideas how to get this solution working without having warnings in all of the tasks all the time, or other ways for the script to know how the reload was initiated?

Tags (4)
1 Solution

Accepted Solutions
arthur_dom
Contributor III

Re: Differentiate desktop client reload and task reload in the script

If the service of reload is different the OSUser() functions probably will get a different content. On reloads the qvb.exe is initialized with the user of QV reload service, and on QlikView Desktop it will use the Windowws user logged in. If you have 2 different users you can store the OSUser() in a variable.

4 Replies
Employee
Employee

Re: Differentiate desktop client reload and task reload in the script

I would set a variable to desktop client, so I could read its value

qv.exe /vvYouVariable=1 <yourwvw>

arthur_dom
Contributor III

Re: Differentiate desktop client reload and task reload in the script

If the service of reload is different the OSUser() functions probably will get a different content. On reloads the qvb.exe is initialized with the user of QV reload service, and on QlikView Desktop it will use the Windowws user logged in. If you have 2 different users you can store the OSUser() in a variable.

Not applicable

Re: Differentiate desktop client reload and task reload in the script

Ah, how did I miss this, of course! I've used OSUser() before but this didn't occur to me for some reason. I guess that's why we have the discussion forum

jaimeaguilar
Valued Contributor II

Re: Differentiate desktop client reload and task reload in the script

Hi,

this is more like a workaround, but you can take advantage of the fact the postreload trigger doesn't work in server reloads. So you can setup a counter variable that only increments if the reload is made by QlikView Desktop, otherwise the counter will remain the same. Also you can store every reload in a qvd so you can track every single reload,

take a look at the example. To test it initialize the vPostReload to 0 (Zero) from the GUI (CTRL + ALT + V), then reload it in Desktop, and after reload you'll see that the variable value changes to 1. Then reload that same document in server, and you'll see that variable value (vPostReload) will remain in 1, even if you manually open the document.

maybe it's not the most elegant solution, but give it a try,

the example is attached

regards

Community Browser