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.
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
Comments
"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);
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.