Temporary Table

One of our customer wants a report that includes both sales invoice line and sales credit memo lines. I know that I have to use a temporary table to combine the two tables. And I also know that what I can do is used an integer data item in the report. My problem is Im not sure on what trigger will I put the code where I will populate the temporary table then later print the record. Anyone? Or is there any better solutions?

The easiest option is to show the Invoices first and the Credit Memos second as then you can just have 2 data items. Most of the time you won’t be this lucky, but you can always try. The best way for a temporary table is: 1) find a table which has the keys you want and then create the temporary variable based on that, for example Sales Invoice Line. 2) On the OnAfterGetRecord Trigger for the Sales Invoice Line and Sales Credit Memo Line, move the Data to the Temporary Table and Insert. You can use either direct assignment or a transferfields. 3) For the integer Dataitem, look at the Sales Invoice (10074) Report. It will show you the code to read through the Temporary table and how to print the data.

Have you considered using the Customer Ledger?

I would create a table with 3 sections… Sales Invoice Header (Allow User to Set filters) Sales Cr. Memo Header (Allow User to Set filters) Both with No Sections - You could argue, to include lines also… The On the Integer section do something like this… -------------------------------- Integer - OnPreDataItem Setrange(Number,1,TempRecord.Count); Integer - OnAfterGetRecord if Number = 1 then TempRecord.FIND(’-’) else TempRecord.Next; --------------------------------------- //Henrik Helgesen -: KISS::Keep it Simple, Stupid :-