Dear All, I need to calculate “Vendor Ledger Entry”.Amount at a report. This field is a FlowField which gets value from “Detailed Vendor Ledg. Entry”. What i have done is: 1. AAmount:=“Vendor Ledger Entry”.Amount / (-1.17) 2. Show the Global AAmount at report, but it always show 0 at the report when printing. What can i do to show a FlowField correct at report? Thanks a lot!
You first have to use CALCFIELDS to calculate a flowfield. Use:
"Vendor Ledger Entry".CALCFIELDS(Amount); When you put the flowfield directly in a section, you don’t have to do anything and Navision will do the calculation for you.
Hi. Tino, Thanks for the reply and advise. My problem is, i need to put a value into section which calculated from a FlowField (“Vendor Ledger Entry”.Amount). You are right, everything is fine if i put the value into section directly. But when i tried to get the value from record and then put it into a section after some kind of calculation, it always shows 0 at the repot. How may i use the CalcFields() function? System prompt error message (Type conversion is not possible because 1 of the operators contains an invalid type. Decimal:=Boolean) when i tried to use it like below: AA := “Vendor Ledger Entry”.CalcFields(Amount); Thanks a lot! Jack
Jack, The code should be as follows:
"Vendor Ledger Entry".CALCFIELDS(Amount); AA := "Vendor Ledger Entry".Amount;
Hi. Tino, Thanks, but it doesn’t work either. Should i do any actions like “set range” something for the FlowField? And i’m not clear how to do so. Thanks, Jack
Jack, It should work fine… I presume you put this code in the OnAfterGetRecord? Maybe you can show the code you use?