We help IT Professionals succeed at work.

Fields do not refresh

Pennywisdom asked
I have a field "TransferDate" that is computed. It's formula is :
@If(Name="";"";@DbLookup(""; ""; "vEmpl"; Name; "TransferDate"))

So when I change the field "Name", "TransferDate" is changed automaticly to the transfer date of the employe.

Now I want to display the number of Years, months and days between now and the transfer date. To do this I have 4 computed fields:
1) "ExpTotalDays" is hidden and has the formula:
@If(TransferDate="";0;@Now - @TextToTime(TransferDate)) / 60 / 60 / 24

2) "ExpYears" that has the formula:
@Integer(ExpTotalDays / 365)

3) "ExpMonths" that has the formula:
@Integer(@Modulo(ExpTotalDays;365) / 30)

4) "ExpDays" that has the formula:

My problem is that these 4 fields are not refreshed automaticly, even if I checked the option "Automaticly Refresh Fields" in the Forms properties. "TransferDate" is refreshed automaticly dought. I don't understand this, can anyone help me out?
Watch Question

Hello Pennywisdom,

you have to be aware of the Z order of field calculation. Z order means: first field in upper left corner, than from left to right every line until last field in lower right corner. So ExpTotalDays field have to be before others using it.

Also include in every field the previous field name needed for calculation. For example, write the formula for the "ExpMonths" field like this:
FIELD ExpTotalDays:=ExpTotalDays;
@Integer(@Modulo(ExpTotalDays;365) / 30)

If this all does not help, than do it like I would do: place all calculation into one field, into TransferDate field. Than it looks like this:
FIELD Name:=Name;
FIELD ExpTotalDays:=ExpTotalDays;
FIELD ExpYears:=ExpYears;
FIELD ExpMonths:=ExpMonths;
FIELD ExpDays:=ExpDays;


tmpTransferDate:=@DbLookup(""; ""; "vEmpl"; Name; "TransferDate");
tmpExpTotalDays:=(@Now - @TextToTime(@Text(tmpTransferDate))) / 60 / 60 / 24;
@SetField("ExpYears";@Integer(tmpExpTotalDays / 365));
@SetField("ExpMonths";@Integer(@Modulo(tmpExpTotalDays;365) / 30));

Be also aware of Text, Number and Date field types.

Good luck,


I placed my fields after TransferDate and it works, didn't need to change any of my formulas.

Thanks alot zvonco!

sorry, I was late 'cose I was testing first all the code.

But anyway thank you Pennywisdom for the points and for the feedback.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.