Line loop with more than 8 conditions

Ivan Nussi

Hello everyone,

to optimize the line loop of a document (do only one cycle for every row with all the controls) I created a single UF, line loop type, with different conditions (SQL condition CASE WHEN Cond1 THEN Result1 WHEN Cond2 THEN Result2 ... WHEN CondN THEN ResultN).

Up to 8 "WHEN" no problem, now that I have 10 "WHEN" I realized that after 8 conditions the following ones don't work.

I tried to move the conditions number 9 and 10 up more and these work, but the ones that became 9 and 10, with the move, don't work.

Did this happen to anyone? Tips?

Comments

1 comment

  • Comment author
    Keshava Best

    If the line loop is not working, you can use a regular macro and create your own loop and actions.

    Simple example:

    @STORE80 = 1
    @STORE81 = $[$38.0.0.LAST]
     
    WHILE @STORE80 < @STORE81
    BEGIN //Loop through order lines
        IF $[$38.11.NUMBER.@STORE80] > 0
        BEGIN 
    //Do your function here
        END
        @STORE80 = @STORE80 + 1
    END

    Keshava
    0

Please sign in to leave a comment.