Customer Top N - Aging

teckpoh
Member Posts: 271
Dear All,
I wish to sort "Age account receivable" report by top N list of customer who has the highest aging will show at top and second higher will show on second row...so and so...
i ever tried to use "Net Change" field as a key in customer table to sort the customer but i can't because it's flowfield..
Any idea how to implement this by modify the existing "age accnt receivable" report?? thank in advance~~!!!
I wish to sort "Age account receivable" report by top N list of customer who has the highest aging will show at top and second higher will show on second row...so and so...
i ever tried to use "Net Change" field as a key in customer table to sort the customer but i can't because it's flowfield..
Any idea how to implement this by modify the existing "age accnt receivable" report?? thank in advance~~!!!
0
Comments
-
teckpoh wrote:Dear All,
I wish to sort "Age account receivable" report by top N list of customer who has the highest aging will show at top and second higher will show on second row...so and so...
i ever tried to use "Net Change" field as a key in customer table to sort the customer but i can't because it's flowfield..
Any idea how to implement this by modify the existing "age accnt receivable" report?? thank in advance~~!!!
Take a look at the Top Customer and the Top Inventory reports in standard Navision to see how this is done. You'll need to replicate the same kind of code in your new aging report.
An easy way is to just export to Excel then manipulate it there.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
i copied the sorting code from "Customer Top 10 List" and paste it in "Age Account Receivable" under customer data item. But the report still not sort by top N customer it still sorted by customer no. .....
Code that i copied
============
Window.OPEN(Text000);
i := 0;
CustAmount.DELETEALL;
CurrReport.CREATETOTALS("Sales (LCY)","Balance (LCY)");
Customer - OnAfterGetRecord()
Window.UPDATE(1,"No.");
CALCFIELDS("Sales (LCY)","Balance (LCY)");
IF ("Sales (LCY)" = 0) AND ("Balance (LCY)" = 0) THEN
CurrReport.SKIP;
CustAmount.INIT;
CustAmount."Customer No." := "No.";
IF ShowType = ShowType::"Sales (LCY)" THEN BEGIN
CustAmount."Amount (LCY)" := -"Sales (LCY)";
CustAmount."Amount 2 (LCY)" := -"Balance (LCY)";
END ELSE BEGIN
CustAmount."Amount (LCY)" := -"Balance (LCY)";
CustAmount."Amount 2 (LCY)" := -"Sales (LCY)";
END;
CustAmount.INSERT;
IF (NoOfRecordsToPrint = 0) OR (i < NoOfRecordsToPrint) THEN
i := i + 1
ELSE BEGIN
CustAmount.FIND('+');
CustAmount.DELETE;
END;
Any idea?? Thank a lot's~~0 -
Where did you find that code? In My Top__Customer List the code looks like this. It uses an Array to gather & sort the data
OnPreDataItem()NextTopLineNo := 1; Window.OPEN(Text000 + ' #1########');
OnAfterGetRecord()Window.UPDATE(1,"No."); IF TopType = TopType::"Balance ($)" THEN BEGIN CALCFIELDS("Balance ($)"); TempAmount := "Balance ($)"; END ELSE BEGIN CALCFIELDS("Sales ($)"); TempAmount := "Sales ($)"; END; GrandTotal := GrandTotal + TempAmount; TopNo[NextTopLineNo] := "No."; TopAmount[NextTopLineNo] := TempAmount; TopName[NextTopLineNo] := Name; i := NextTopLineNo; IF NextTopLineNo < (CustomersToRank + 1) THEN NextTopLineNo := NextTopLineNo + 1; WHILE (i > 1) DO BEGIN i := i - 1; IF (TopAmount[i + 1] > TopAmount[i]) THEN BEGIN // Sort the Customers by amount, largest should be first, smallest last. Put // values from position i into save variables, move values from position // i+1 to position i then put save values back in array in position i+1. TempNo := TopNo[i]; TempAmount := TopAmount[i]; TempName := TopName[i]; TopNo[i] := TopNo[i + 1]; TopAmount[i] := TopAmount[i + 1]; TopName[i] := TopName[i + 1]; TopNo[i + 1] := TempNo; TopAmount[i + 1] := TempAmount; TopName[i + 1] := TempName; END; END;
& don't forget the code that is needed onnthe print loop -integer dataitem.
I would suggest exporting to excel too & just sort the column you want.
In fact here ya go!
http://savatage99.googlepages.com/50085 ... ngInfo.fob0 -
In version 5.0, the Aged Accounts Receivable report is already preconfigured to be able to print to Excel.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
-
In version 5.0, the Aged Accounts Receivable report is already preconfigured to be able to print to Excel.
Version 4 already has the option.CA Sandeep Singla
http://ssdynamics.co.in0 -
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