FlowField Values are not getting calculated when i write a Code

Hello Everybody,

I am very confused as i am not able to calculated the value of the flow field in the following code. It always gives the values as zero.

CustomerLedgerEntry.RESET;

CustomerLedgerEntry.SETRANGE(CustomerLedgerEntry.“Customer No.”,“Sell-to Customer No.”);

CustomerLedgerEntry.SETRANGE(CustomerLedgerEntry.Positive,FALSE);

CustomerLedgerEntry.CALCFIELDS(“Credit Amount”);

IF CustomerLedgerEntry.FINDFIRST THEN

BEGIN

REPEAT

totalcredit:=CustomerLedgerEntry.“Credit Amount”;

UNTIL CustomerLedgerEntry.NEXT=0;

end;

the value of the Totalcredit variable always comes as 0. But the credit amount field in Customer ledger entry table has values i dnt knw wht to do very confused?

Please help me!!!111

Hi,

Write CustomerLedgerEntry.CALCFIELDS(“Credit Amount”); after Begin

This will help you

Put the filters in the customer ledger entry table as in the code & check what is the result.

I have tried this also but nothing is working for me

In Table means I did nt understnd

Put a message after

totalcredit:=totalcredit + CustomerLedgerEntry.“Credit Amount”;

If last record has zero value in CustomerLedgerEntry.“Credit Amount”. it will assign 0 only as per your code…

Dont forget to initialize the totalcredit variable before the calculation…

Thanku very much Amol nw it is wrkng, Good wrk thnks a lot

Go to any customer card & on balance field click on the drill down button.

After that click in the Show all button in the menu bar, the allpy filters as you have written in the code.

When the records are filtered check the result and compare the same.

Thanks a lot