vendor summary aging

lamis
Member Posts: 46
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
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
Best Answer
-
Hi,
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.5
Answers
-
Hi,
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.5 -
Thank you for your reply. It had worked properly. But I still have a small problem actually.
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!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions