Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
We value your feedback – take our 5-minute QlikView modernization survey
cancel
Showing results for 
Search instead for 
Did you mean: 
carolin01
Luminary Alumni
Luminary Alumni

Trigger and Scheduled Load via Management Console

Hi,

I´ve set some triggers in my application that should change some variables and tried both cases: "On Opening" and "OnPostRelaod". The issue is that I can see in the log file that after the scheduled relaod via the Management Console the variable hasn´t been changed to the new value. Example:

I set the following trigger to set the value for the variable "vDocumentType":

=if(SubStringCount(DocumentName(),'Test')='1', 'Test',if(SubStringCount(DocumentName(),'Live')='1', 'Live', if(SubStringCount(DocumentName(),'Development')='1', 'Development', 'Invalid File Name - Check vDocumentType')))

Then I use the variable in my binary load in my script:

Binary [$(vScriptPath)\scripting financial sales application $(vDocumentType) security.qvw];

Next my document gets a new name and includes the word "Live". Because of this my trigger should set the value of the variable "vDocumentType" to "Live" instead of "Test". The trigger is working if I manually reopen the document. I expected this to be working also automatically without having to open the document once more by hand, because I thought that in the background the management console also opens the document and then this would activate the trigger. But this is what happens:


Extraction of the log file after the scheduled reload via the Management Console:

  1. 02.02.2016 09:36:34:      Execution started.
  2. 02.02.2016 09:36:34:      QlikView Version:11.20.12664.0
  3. 02.02.2016 09:36:34:      CPU Target x64
  4. 02.02.2016 09:36:34:      Operating System Windows Server 2008 R2 Standard Service Pack 1 (64 bit edition)
  5. 02.02.2016 09:36:34:      Wow64 mode Not using Wow64
  6. 02.02.2016 09:36:34:      MDAC Version 6.1.7601.17514
  7. 02.02.2016 09:36:34:      MDAC Full Install Version     6.1.7601.17514
  8. 02.02.2016 09:36:34:      PreferredCompression 2
  9. 02.02.2016 09:36:34: EnableParallelReload          1
  10. 02.02.2016 09:36:34: ParallelizeQvdLoads 1
  11. 02.02.2016 09:36:34: AutoSaveAfterReload 0
  12. 02.02.2016 09:36:34: BackupBeforeReload 0
  13. 02.02.2016 09:36:34: EnableFlushLog 0
  14. 02.02.2016 09:36:34: SaveInfoWhenSavingFile        0
  15. 02.02.2016 09:36:34: UserLogfileCharset 1200
  16. 02.02.2016 09:36:34: OdbcLoginTimeout -1
  17. 02.02.2016 09:36:34: OdbcConnectionTimeout         -1
  18. 02.02.2016 09:36:34: ScriptWantsDbWrite false
  19. 02.02.2016 09:36:34:      ScriptWantsExe false
  20. 02.02.2016 09:36:34:      LogFile CodePage Used:        1200
  21. 02.02.2016 09:36:34:       Reload Executed By EU\qlikviewservice
  22. 02.02.2016 09:36:34:       Process Executing: QVB
  23. 02.02.2016 09:36:34:       Process ID: 14696
  24. 02.02.2016 09:36:34: 0002 Binary [..\02 Skript-Files\scripting financial sales application Test security.qvw]


As you can see the name is still "Test" instead of "Live". I would like to use such a function in many different ways so that the solution should include that this works automatically. Reopening of the document is not a solution because the document needs 20 Minutes to open. Any idea?

Many thanks in advance

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

The OnOpen and OnPostReload triggers are not fired when the document is hosted and reloaded in QV server.

I would suggest setting the variables in the script, but you cannot do that before a binary load. Have you invertstigated passing the variable as a parameter. In a batch load from QV desktop. you would use the /v switch. I think you can set a a parameter in server as well, but I don't have one available to check.

Example in desktop: qv.exe /r /vvDocumentType=Live abc.qvw

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

The OnOpen and OnPostReload triggers are not fired when the document is hosted and reloaded in QV server.

I would suggest setting the variables in the script, but you cannot do that before a binary load. Have you invertstigated passing the variable as a parameter. In a batch load from QV desktop. you would use the /v switch. I think you can set a a parameter in server as well, but I don't have one available to check.

Example in desktop: qv.exe /r /vvDocumentType=Live abc.qvw

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
carolin01
Luminary Alumni
Luminary Alumni
Author

Thank you!