Message on AP check stub

Our users will be entering a comment on the invoice header. When they select that invoice for payment they want the comment to print under the invoice line on the check stub. My problem is how to get around the max iterations of 10 but still make sure that only 10 lines (invoices and comments) print on the stub and that the check gets voided if there are more than 10 lines on the stub. Has anyone done something like this? Any ideas? Thanks, Lori

you could make it using Integer system table, filtering Number field from 1 to 10 using C/AL or properties. i think C/AL is better because you can take more control about report behavior. for each Integer you have read, a comment has to be read manually and printed. also you could check if there are less than 10 comment lines, to filter Integer dataitem…

Use the same array, DataItems…Just add another Report Section and only show one or the other.

Thanks for your help, but I don’t see how that will solve controlling how many lines are on the stub (comments and documents) voiding the check. Now part of the control is in the max iterations on the PrintSettledLoop dataitem. Is there a way to change the counting of the iterations through C/AL?

I do not have a copy of Navision handy as I write this message. I seem to recall that the shrinkwrapped US version is a “stub-stub-check” report: two copies of a stub are printed on the top 2/3 of the page with a check on the bottomn. I am pretty sure the stub is generated using an 10-row by several-column text-variable array. If you need more than ten lines, a extra page is printed with the check voided out on pages after the first. It should be simple enough to change the check report to print a message at the bottom of each stub. You could include the message in the text array, or you could add a separate variable for the message. The programming would (I am pretty sure) be a lot simpler if the message goes all the way at the bottom of the stub rather than exactly one line below the last stub line :slight_smile: I might add that the check report objects vary quite a bit from one national version of Navision to another.

I guess it would help if I was looking at the base version of the cheque :slight_smile: There are a few different ways to do this. How about creating a Comment Text variable. In PrintSettled Loop, if the variable has a value, then print the value, otherwise, go through the existing routine and print the line details. The only other coding would be setting and clearing this value. This method would allow you to use the existing MaxIteration, etc.

I was just thinking: maybe what Lori wants is two lines per invoice rather than just one. In that case, it might be best to create a 5-row by 1-column text variable for CommentText, and place each CommentText below the other lines for the invoice. Or, we could add an extra column to the existing array (and print the last column on a row below the line with the standard columns’ text.) Sometimes, a check is printed for reasons other than paying off a posted purchase invoice (e.g., because of a sales credit memo.) In that case, we would either have to live with having up to 5 blank lines on each stub, or we could have different report sections for invoices and other payments. It would be MUCH simpler to live with the 5 blank lines.