Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic Update Command in Macro not working in accesspoint

Hello,

I have a macro that uses the DynamicUpdateCommand to insert records into a table. This works perfectly locally, but in accesspoint using the ie plugin (QV 11) the macro fails.  I'm trying to create a field to be used as a chart dimension, but that needs to be recalculated based on the user's selections.

I have other macros that are working, so I think I have all of the settings right... including the document and server dynamic update settings.

In my google research I came across something about needing something else in the licensing in order to do dynamic updates?

Can anyone help me understand how to get this working?

I've included my macro code below...

Thanks!

Karen

*******************************************************************************************************

sub assignquartile()

set APP = ActiveDocument.GetApplication

UserID = ActiveDocument.Evaluate("OsUser()")

  

sqlstr = "DELETE FROM Dynamic_Dim_Table WHERE UserName = '"&UserID&"'"

SET Result = ActiveDocument.DynamicUpdateCommand(sqlstr)

APP.WaitForIdle 500

sqlstr = ""

set tb=ActiveDocument.GetSheetObject("CH67")

batchcount = 0

for rw = 1 to tb.GetRowCount-1

set x = tb.GetCell(rw,0)

line = x.number

set y = tb.GetCell(rw,4)

cumpct = y.number

'msgbox(tb.GetCell(rw,2).number)

'msgbox(cumpct)

if cumpct < .25 then

qt = "First Quartile"

else

  if cumpct < .5 then

    qt = "Second Quartile" 

  else

    if cumpct < .75 then

      qt = "Third Quartile" 

    else

      qt = "Fourth Quartile" 

    end if

  end if

end if

sqlstr = sqlstr & "INSERT INTO * (LineNo,UserName,Quartile) VALUES ("&line&","&UserID&","&qt&");"

BatchCount = BatchCount+1

IF BatchCount>6000 Then

'msgbox(sqlstr)

 

  SET Result = ActiveDocument.DynamicUpdateCommand(sqlstr)

APP.WaitForIdle 500

  sqlstr = ""

  BatchCount = 0

End if

  

'msgbox(lineid.number)

'ActiveDocument.ShowPopup rw&" of "&tb.GetRowCount-1,.5

next

if sqlstr <> "" then

SET Result = ActiveDocument.DynamicUpdateCommand(sqlstr)

APP.WaitForIdle 500

end if

   

'msgbox(now())

end sub

*************************************************************************************

10 Replies
mayankraoka
Specialist
Specialist

Hi Chandel,

Need your inputs.

Did all the setting required for dynamic update mentioned above.Using action button for dynamic.

Working fine on desktop but not from access point?User is present in qlik admin group.

Regards,

Mayank