Hello,
I have a problem in vendor summary aging report. It is not filtering on the dimensions.
I have tried to add this code:
Vendor - OnAfterGetRecord()
PrintLine := FALSE;
LineTotalCustBalance := 0;
Vendor.COPYFILTER("Currency Filter",DtldVendLedgEntry."Currency Code");
//MOD01 start
Vendor.COPYFILTER("Global Dimension 1 Filter",DtldVendLedgEntry.''Initial Entry Global Dim. 1");
Vendor.COPYFILTER("Global Dimension 2 Filter",DtldVendLedgEntry.''Initial Entry Global Dim. 2");
//MOD01 ENd
FOR i := 1 TO 5 DO BEGIN
...
It is still not filtering on the proper values.
Please any advise?
Thanks
0
Answers
I dont know what version of nav you are running.
anyway I looked for that code in R305 and it is like this on integer predataitem event:
IF PrintAmountsInLCY OR NOT PrintLine THEN
CurrReport.BREAK;
Currency2.RESET;
Currency2.SETRANGE("Vendor Filter",Vendor."No.");
Vendor.COPYFILTER("Currency Filter",Currency2.Code);
IF (Vendor.GETFILTER("Global Dimension 1 Filter") <> '') OR
(Vendor.GETFILTER("Global Dimension 2 Filter") <> '')
THEN BEGIN
Vendor.COPYFILTER("Global Dimension 1 Filter",Currency2."Global Dimension 1 Filter");
Vendor.COPYFILTER("Global Dimension 2 Filter",Currency2."Global Dimension 2 Filter");
END;
on aftergetrecord:
IF Number = 1 THEN
Currency2.FIND('-')
ELSE
IF Currency2.NEXT = 0 THEN
CurrReport.BREAK;
Currency2.CALCFIELDS("Vendor Ledg. Entries in Filter");
IF NOT Currency2."Vendor Ledg. Entries in Filter" THEN
CurrReport.SKIP;
PrintLine := FALSE;
LineTotalVendAmountDue := 0;
FOR i := 1 TO 5 DO BEGIN
DtldVendLedgEntry.SETCURRENTKEY("Vendor No.","Initial Entry Due Date");
DtldVendLedgEntry.SETRANGE("Vendor No.",Vendor."No.");
DtldVendLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate,PeriodStartDate[i + 1] - 1);
DtldVendLedgEntry.SETRANGE("Currency Code",Currency2.Code);
DtldVendLedgEntry.CALCSUMS(Amount);
VendBalanceDue := DtldVendLedgEntry.Amount;
InVendBalanceDueLCY := InVendBalanceDueLCY2;
IF VendBalanceDue <> 0 THEN
PrintLine := TRUE;
LineTotalVendAmountDue := LineTotalVendAmountDue + VendBalanceDue;
END;
I would suggest see if dtldVendLedgEntry.''Initial Entry Global Dim. 1" has values using debugger, see what filters have been applied to vendor and so on.
The total Balance that appears in the report is correct but the values are not shown for every interval of time. For example, if the total balance for a specific vendor is 1000$, it is not being divided through out the months( January,February and March)..
Any suggestion?
Thank youu!