Hello All
I am working on printing a picking list that depends on the status of the shipping advice field within the sales header (partial or complete).
Once that has been determined for each order, I need to check against the reservation table and only show order lines that currently have reservations against them.
If the status is complete, all lines need to have reservations for the location within each sales line for the order. If any lines are not reserved, nothing should print.
If the status is partial, the picking list should only print those lines that have reservations.
Question is - where should i put this code?
I have tried to place it within OnAfterGetRecord but the link between Sales Header and Sales Line is acting strange.
Ideas?
Thanks
0
Comments
I have placed my code within OnPreDataItem of the Sales Line data item i.e. the data items:
Sales Header
Sales Line
This I think is working, however for some reason, even if I comment out my code, when I run the report for all orders - the first order prints the first header twice and all subsequent body lines are not correct. If I print a single random order all is fine......
Why am I getting the first record from sales header being printed twice, meaning that the sales line records are printing for the wrong headers?
Ideas and is the right approach?
Thanks
Now.. on the OnAfterGetRecord on the salesline you would put the code that determines whether there are reservations for the line or not. If there isn't you should issue the command: CurrReport.SKIP. This will skip the salesline and move on to the next one.
The above should work as you wish......
Now if you don't want the section with info from the salesheader to be printed if there are no saleslines that have reservations on them you should change the properties on the salesheader-DATAITEM so the property "PrintOnlyIfDetail" is set to YES.
Tommy