Calculate with Flow Fields

hey in a form are 3 fields. field1 is an flow field field2 is an decimal field(user input) field3 is an decimal field(field1-field2) When tha value of field1 is changed, field3 is not updated. Thanks for help. lothar knichel

Field 1 one CANNOT be changed it it’s a flowfield, most flowfields in the standard application are set as non-editable at table level. Are those 3 fields on the same form ? ###### tarek_demiati@ureach.com

Hi!

quote:


When tha value of field1 is changed


As far as “field1” is a flow field, i assume that you mean by “changed” that the shown value, calculated by “CalcFormula” has changed. To calculate “field3” you should use a small function:


Function Calc()
CALCFIELDS(field1);
field3 := field1 - field2;

This funktion should be called in “field2” OnValidate() of the Table and OnAfterGetRecord() of the Form This should do the job! Regards, Jörg Joerg A. Stryk Apollo-Optik, IT/ERP Edited by - stryk on 2001 Nov 30 10:45:42

Hallo Tarek, field1 is changed by the system and not by user. the fields are on the same form.

Hi Joerg, it works. Thanks Lothar Knichel

Sorry Guys noting clever required here on the form select fields 1 and 2 the non flowfields. Code OnAfterValidate() CurrForm.UPDATE; That will refresh the flowfield David Cox email: david@mindsource.co.uk

Hi joerg, first i think it works but it doesn´t. When i change the value in field2 (FieldClass=normal) the field3(FieldClass=FlowField)is changed correctly. And i can use the value for other thinks. But when the value in field1 (FieldClass=FlowField)is changed the field3(FieldClass=FlowField)is changed only on the form correctly, and i can´t use the value for other functions. Lothar Knichel

Hi David Cox, please read my last post to Joerg. Lothar Knichel

quote:


But when the value in field1 (FieldClass=FlowField)is changed the field3(FieldClass=FlowField)is changed only on the form correctly, and i can´t use the value for other functions.


Thats rigth! Because field3 is based on a FlowField (which is not saved to the databese) I think it’s not neccessary to save field3 … Why is field3 a FlowField? It also could be a “normal” Field!? But, if you need to use the value of field3 in other functions, you should always run the function Calc() (my little example) to make sure, that field3 has an actual value (Same as you use CALCFIELDS on FlowFields before use). Regards, Jörg Joerg A. Stryk Apollo-Optik, IT/ERP