Ok, I created a temp table TempReceipts (Subtype: ‘Receipts Table’, Temporary: Yes) and Integer in Gloabal Variables.
I also setup keys on the ‘Receipts Table’ as ‘Posted Invoice No.’ (the same as No. in ‘Sales Invoice Header’, ‘Document No.’ (represent ‘Receipt No.’ in other tables), and Date. I entered these keys on separate lines and also as three together. The combination of the keys however is not giving unique combination in the ‘Receipts Table’ table.
I’m trying to implement a code as below but the Temp table seems as empty anyway as if I put TempReceipts.”Document No.” on an integer body section in the Report layout there is nothing in that section.
Please, help.
I do have DataItems now as below:
‘Sales Invoice Header’
Integer
‘Transaction Header’
‘Transaction Sales Entry’
//=====================================
Integer - OnPreDataItem():
//=====================================
TempReceipts.INIT
TempReceipts.DELETEALL
TempReceipts:=”Receipts Table”;
TempReceipts.SETCURRENTKEY(‘Posted Invoice No.’, ‘Document No.’, Date);
IF TempReceipts.FINDFIRST THEN
REPEAT
TempReceipts.SETRANGE(“Posted Invoice No.”, TempReceipts.“Posted Invoice No.”);
TempReceipts.SETRANGE(“Document No.”, TempReceipts.“Document No.”);
TempReceipts.SETRANGE(Date, TempReceipts.Date);
TempReceipts.FINDLAST;
TempReceipts.SETRANGE(“Posted Invoice No.”);
TempReceipts.SETRANGE(“Document No.”);
TempReceipts.SETRANGE(Date);
UNTIL TempReceipts.NEXT = 0;
TempReceipts.RESET;
SETRANGE(Number,1, TempReceipts.COUNT);
//============================================
Integer – OnAfterGetRecord:
//============================================
IF Number = 1 THEN
TempReceipts.FIND(’-’)
ELSE
TempReceipts.NEXT;
//============================================
Transaction Header – OnPreDataItem()::
SETRANGE(“Receipt No.”, TempReceipts.”Document No.”);
I don’t also have any idea how I could link the Integer table to the Up table (‘Sales Invoice Header’) and to the Down tables that are in the DataItems (‘Transaction Header’ and ‘Transaction Sales Entry’).
The Integer temp table should be somehow linked to “Transaction Header” table via has “Receipt No.” and “Document No.”. Then the “Transaction No.” or “Receipt No.” fields could be used to link further down to the ‘Transaction Sales Entry’ table.
Thanks