1 Reply Latest reply: Oct 21, 2011 9:34 AM by Mirco Andreon RSS

    DynamicUpdateCommand stops working after QV restart

    Mirco Andreon

      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  
      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!

        • Re: DynamicUpdateCommand stops working after QV restart
          Mirco Andreon

          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
          end sub

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