How to Sum By Customer Posting Group.
kolaboy
Member Posts: 446
Hi
I am trying to sum customers total balances by Posting Group. Here is a code i wrote but it not working. can someone help me with this.
I need it like this
BAK
20000 i.e the total arrears for all the customers with Posting group of BAK
BRDAL
48090
BTU......................32090 ans so on
I am to create a report to display the information as above.
Can somone help me Please.
Thanks
I am trying to sum customers total balances by Posting Group. Here is a code i wrote but it not working. can someone help me with this.
IF Customer."Customer Posting Group" = 'BAK' THEN BEGIN IF Customer."Monthly Install" <> 0 THEN BEGIN //BAKTotalCustBal := "Detailed Cust. Ledg. Entry"."Amount (LCY)"; BAKCustBal1 := "Cust. Ledger Entry". Amount; BAKArreasVar:= -Customer."Monthly Install" - "Cust. Ledger Entry".Amount; END; END; BAKArreasVarTotal:=ArreasVarTotal+BAKArreasVar; BAKTotCustBal1 += BAKCustBal1; END;
I need it like this
BAK
20000 i.e the total arrears for all the customers with Posting group of BAK
BRDAL
48090
BTU......................32090 ans so on
I am to create a report to display the information as above.
Can somone help me Please.
Thanks
0
Comments
-
The Cust. Ledger Entry table Amount field is a flowfield. To have it populated with the amount you must
"Cust. Ledger Entry".CALCFILELDS(Amount);
Then you can add the amount to your variable.
But a more efficient way of getting the customer balance is
Customer.CALCFIELDS(Balance);0 -
Yes, you can use the Balance field and you can use the CREATETOTALS on the report to calc the totals. Search for the CREATETOTALS and how to use it in Manual or on the forum.0
-
Hi there its better to use the Rec.Calcfields(Amount) or the CREATETOTALS on the OnPreDataItem0
-
siyak wrote:Hi there its better to use the Rec.Calcfields(Amount) or the CREATETOTALS on the OnPreDataItem
The commands are for totaly different purpose there... you cannot ask "what is better"... you need CALCFIELDS to cal correct value of the flowfield, you need CREATETOTALS to create totals of some variable/field...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
- 323 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
