Hello, We have modified the AP Check for a customer to print an annual “dividend” check for it’s members. There are 15,000+ checks that need to be printed. If I try to print all of the checks at once from the payment journal I see the “searching the Gen. Jnl. Line table” message box intermittently popup which would suggest a missing or wrong key and 2 to 3 minutes to print each check. None of the code for Gen. Jnl. Line or any of it’s variables has been modified (only address printing through a function call to Format Address). The searching of the table occurs in 2 places: (1) CheckPages - OnPostDataItem: The REPEAT … UNTIL statement: IF GenJnlLine2.FIND(’-’) THEN BEGIN HighestLineNo := GenJnlLine2.“Line No.”; REPEAT IF GenJnlLine2.“Line No.” > HighestLineNo THEN HighestLineNo := GenJnlLine2.“Line No.”; GenJnlLine3 := GenJnlLine2; GenJnlLine3.TESTFIELD(“Posting No. Series”,’’); GenJnlLine3.“Bal. Account No.” := ‘’; GenJnlLine3.“Bank Payment Type” := GenJnlLine3.“Bank Payment Type”::" "; GenJnlLine3.“Document No.” := UseCheckNo; GenJnlLine3.“Check Printed” := TRUE; GenJnlLine3.VALIDATE(Amount); “TotalLineAmount$” := “TotalLineAmount$” + GenJnlLine3.“Amount (LCY)”; GenJnlLine3.MODIFY; UNTIL GenJnlLine2.NEXT = 0; END; (2) PrintSettledLoop - OnAfterGetRecord: FoundLast := GenJnlLine2.NEXT = 0; We are using 3.7 on SQL Server. Is this just a limitation of Navision? Has anyone else had this problem or a possible solution? I realize we could just cut and paste entries into the journal but would like to run the process unattended. Thanks. Brian.
in SQL. SQL server selects the best key, and it looks like the isn’t a good key. What are the filters for GenJnlLine2? Run the gen. journal line table directly from object designer and tell me how many records are there? You normally get the window pop for searching on tables that have more than 500 records or more
There are 15,000 entries in the Payment Journal (Gen. Jnl. Line table) one per check per member, however we can print 6000 - 7000 checks with no problem. Brian.
can you put the following code before the line IF GenJnlLine2.FIND(’-’) THEN BEGIN like this Message( GenJnlLine2.getfilters); IF GenJnlLine2.FIND(’-’) THEN BEGIN see what the filters are and check if there is a good key.
Thanks Ahmed, for the response the problem was in fact the key for GenJnlLine2 in the GenJnlLine data item. The key only uses the first 4 fields of the filter which has 10 fields. I guess this works fine when you are printing only a few checks or a few hundred but not thousands. Brian.