Hello,
i need to do a report showing all sales orders from table 36 "Sales Header" and table 5107 "Sales Header Archive".
I have these tables as seperate two dataitems in the report.
An order which is created and saved in table 36 and archived in table 5107 at the same time should not be printed twice in the report, so only one time, saying from table 36. How can I realize that in C/AL Code?
I thought of SETRANGE function, but I am not sure. I appreciate any help! Thank you very much.
Regards
Lump86
0
Comments
how are your sorting needs? Do you have to alternate records from one and the other table, or can you just print records from one, then records from the other?
With alternating record source you need a buffer table. You probably be able to single out unwanted records on insert to the buffer table.
If one after the other (both dataitems have the same DataItemIndent), set filters on Sales Header from "Sales Header Archive" and use ISEMPTY like this:
thanks for your help :thumbsup:
Regarding sorting needs: Both of my dataitems share the same intent.
So if a sales order is created and archived at the same time (same record in both tables, i.e. Tables 36 and 5107) only the record from Table 36 should be printed in the report.