Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bluishjoe
Contributor III
Contributor III

DynamicUpdateCommand stops working after QV restart

Hello, I'm using DynamicUpdateCommand inside a macro in this way:

sub addOrder

  set choosen = ActiveDocument.Fields("NUMORD").GetPossibleValues

  for i = 0 to choosen.Count - 1

    set result = ActiveDocument.DynamicUpdateCommand("UPDATE * SET CHOOSE = 'S' WHERE NUMORD = '" & choosen.Item(i).text & "' " )

    if result = false then

      MsgBox result.ErrorMessage

    end if 

  next

end sub

Dinamic Data Update is enabled.

It works, but, when I close QlikView and reopen it, it doesn't work anymore. Reloading doesn't affect it.

I empirically realized that to make it work again I need to change something in the UPDATE, for example turning the '*' into 'MYTABLE'.

I can I solve this weird issue? Maybe is it connected with RAM and way of saving .qvw to the file system?

Many thanks!

1 Reply
bluishjoe
Contributor III
Contributor III
Author

I worked more on it and I realized that to make DynamicUpdateCommand work again I only need to save the document (Ctrl+S)... I don't know why!

I'm doing it programmatically on document opening, with this workaround:

  • Document Properties... > Triggers > Document Event Triggers > OnOpen > Add Action(s)... > Add > External > Run macro > set Macro name = reactivateDynamicUpdateCommand
  • Tools > Edit Module...: add this subroutine:

sub reactivateDynamicUpdateCommand

     ' I know, it's weird

     '... but needed to reactivate DynamicUpdateCommand functionality after a restart

     ActiveDocument.Save

end sub

It works, even if a better solution would be appreciated. Thanks!