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

Error in a macro

I have a strange behavior in a Macro that you need to do is update the fields in a table.

This is the macro:

sub OutLote

  for k = 1 to ActiveDocument.Evaluate("=getSelectedCount(Order_Id)")

    OutValue = ActiveDocument.Evaluate("=subfield(getFieldSelections(Order_Id, ';', 25), ';' ,"&k&")")

    ActiveDocument.DynamicUpdateCommand("UPDATE SEL SET Lote=Null() WHERE Order_Id="&OutValue&"")

  next

end sub

The strange behavior is that sometimes leaves the computer "hung" and do not know why it is. The same is silly but not see it.

Its aim is to update a table (SEL) with basic data are:

Order_Id, Lot and Date

In this case, you must make is to put the Lot = Null in the records selected through Order-Id.

In some cases, when multiple values ​​are selected Order_Id eg 10 values ​​(limit of 25), running, does it perfectly for 5 different, if we run without doing anything more, is doing well other 2 or 3 and so on down.

At the end is where you leave your computer "hanging"

Can you  check it?

TX

Enrique

12 Replies
ecolomer
Master II
Master II
Author

Any idea??

ecolomer
Master II
Master II
Author

I can put msgbox, but I don't know activwe debug mode

ecolomer
Master II
Master II
Author

New version ... QV

Now works ...!!