# How to get the value of another table at the first palce?

I have added a field "Total Absence1’, and “Net Amount” in the “Employee” Table. I want to fetch the value of “Total Absence (Base)” which comes from “Employee Absence”, into the “Total Absence1”.

The “Net Amount” field calculate the amount of total Salary of the Employee (deducting Tax and including bonus etc).

I have written a code in Total Absence1 - On Validate ()

Totabs.RESET;

Totabs.SETRANGE(“Employee No.”, “No.”);

IF Totabs.FINDFIRST THEN BEGIN

“Total Absence 1” := Totabs.Quantity;

END

When this code is run… I get “0” value in the “Total Absence1”, where i need the value of “Total Absence (Base)”, for my calculation.When I enter ANY (right or wrong) value in “Total Absence1”, then only the correct value is fetched into the field and correct “Net Amount” is shown. Well, So i would like to know how can I fetch the correct value of “TotalAbsence1” in the first place itself so I do not need to hit the values manually.

Did you try to create Total Absence 1 field as Flow Field?

Is it Fowfield ?

If Yes then you need to calcualate that before updating it in another field

Use Calcfields for calculate.

if the quantity field in total absence(base) table is flow filed write folow code

Totabs.RESET;

Totabs.SETRANGE(“Employee No.”, “No.”);

IF Totabs.FINDFIRST THEN BEGIN

Totabs.calcfields(quantity);

“Total Absence 1” := Totabs.Quantity;

END

No I have not used it as Flow Field, I have made Field Class as “Normal”.

Can you explain me, what were you explaining about calcfield.

if the field quantity in total absence(base) table is flow field , flow filds are virtual fields by defaul it takes the values to 0 so we have to calculate them by using calcfields

Flow fields are virtual fields by default it takes the value to 0 so we have to use calcfileds function to calulate flow fields o and check for field quantity in total absenc(base) whther it is flow filed or normal?

FlowFields are virtual fields. The values in these fields are not saved in the table. This means that you must use the CALCFIELDS function to update them. For example, if you retrieve a record using the FIND Function (Record) and NEXT Function (Record), the FlowFields in those records are set to zero (0). Then, when you call CALCFIELDS, their values are updated.

When a FlowField is a direct source expression of a control on a form or a report, the calculation will be performed automatically.

CustomerRec.SETRANGE(“Date Filter”,010108D,123108D);
CustomerRec.CALCFIELDS(Balance, “Net Change”);

So you should which is flow field in table and how to calculate it…

Total Absence1 is not the table, it is the field of “Employee” Table.

quantity field in total absence(base )-table i am asking for? is it flowfiled or normal ?

sorry but total absence (base) is not a table , it is a field which is flowfield

would you provide me the code for this so that i can use these values for calculation

using the calcfield for “total absence (base)” also didn’t work.

u have to write this code in employee no onvalidate not in total absence 1 onvalidate because wen u selecting employee automatically values are calculating

here Totabs refers to the employee absence table

Totabs.RESET;

Totabs.SETRANGE(“Employee No.”, “No.”);

IF Totabs.FINDFIRST THEN BEGIN

Totabs.calcfields(total absence(base));

“Total Absence 1” := Totabs.total absence(base);

End;

Hi togheter, i’m new to this forum and to Navision.

I did make a form and placed there a textbox, now i would like to show in this textbox, the
Field “Contract (Invoiced Cost)” from the table 1001 Job Task.

How can i do it? what comes in the SourceExp? also something with calcfield. but what…

Thanks anyway!

Welcome to DUG!!!

What is source table of your form .Is your form bound to table.?

The stuff that you are trying to do here is pretty basic stuff when dealing with Tables in Dynamics NAV.

From the answers of the persons above you can probably guess that there are more than one solution to your problem C/Side and AL in NAV is very complex and if this is just one of your future tasks you want to solve yourself I strongly suggest you download the training material C/Side Introduction and C/Side Solution Development - you can find it on Partnersource. Going through these will make things soo much easier for you.