Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
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
Not applicable
Author

Hello all 🙂

We've got it working here, so I thought I'd post the solution to help anyone googling this same problem in the future:

There are settings that need to be set correctly within the document as well as on the server... here are screen shots of our settings now:

within the document:

settings > Document properties>Server tab

Image 1.jpg

In the tools> edit module

Image2.jpg

on the server:

2013-06-17 15 22 08.jpg

Now that the macro is working on the server, we'll start testing it with multiple users... wish me luck 🙂

Karen

hirenjadiya
Partner
Partner

Hi Karen,

I am also facing the similar issue. The ActiveDocument.DynamicUpdateCommand is not working on Access Point. Although it works locally on my PC.

I have made all the changes what you have suggested like -

- Within Document>>Settings>>Document Properties>>ServerTab

- In Macro Reference Module Security -> System Access and Current Local Security -> Allow System Access

- On Server checking all the check box under Security>>Miscellaneous

Even after making all these changes the ActiveDocument.DynamicUpdateCommand is not working.

What would be your best suggestion?

Thanks in Advance.

juleshartley
Specialist
Specialist

Hi Hiren,

We also have this problem - did you find a resolution?

Thanks

Not applicable
Author

Hi Julian,

We never did resolve this… the most I could find out was that macro functionality can work perfectly on the desktop, but be unstable on accesspoint.

I’m sorry ☹ But if you find a way to make it work, please let me know!

Karen Bardon

juleshartley
Specialist
Specialist


No problem - will let you know!

balkumarchandel
Specialist II
Specialist II

It was easy when you know it

User has to be in QlikView Administrator group in Windows in order to use Dynamic Update.

juleshartley
Specialist
Specialist

Thanks - but they were!

balkumarchandel
Specialist II
Specialist II

Hi Julian,

Can once again do all the setting given in above screenshot and then try to add yourself i QlikView Administrators Group (in QMC) . I was facing the same issue. Once I added my ID in QlikView Administrators Group and now its working fine in access point.

balkumarchandel
Specialist II
Specialist II

or Just send me your application (after removing your sensitive data ) with dummy data. Will check this out.