New Fields

Hello ! I have 3 physical fields of which the third field is filled with the sum of field number 1/2. In my form I get a proper sum in field 3, but it´s not written in the table. How can I solve this problem ? Thx in advance !

you must have written some coding to get the total for the 3rd field right? what coding have you written to get the total for the 3rd field, and where have you put the coding for the 3rd field? my guess is, probably you have used a variable to store the calculated value, that is why the calculated figure is not in your table. if it is, then you can change the coding to store the calculated value to the field table. jordan

Fiel1 - OnValidate Field3 := Field1 + Field2; Field2 - OnValidate Field3 := Field1 + Field2; Regards Alfonso Pertierra (Spain)apertierra@teleline.es

Be very carefuly with OnValidate() trigger. This trigger called only in 2 cases: data entered by keyboard, trigger called from code. If you make this (table has 3 fields, Field3:=Field1+Field2): Table.Field1 := 1; Table.Field2 := 2; Table.INSERT; then all validations will be ignored (used in posting sequences). If values in Field1 and Field2 entered by user then all will be works. But if values are filled by code then be carefull. Business Applications Programmer Sertified Navision Developer SIA “Sintegra” Latvia

That’s why when setting by code a value to a field you should by default use always VALIDATE(Field,Value) instead of Field := Value (excepting when you know there is a code in the validate function that you are not wanting to use). That’s why, following that own standards, some of Navision standard code sucks… as is usual to find a lot of code with inserts without the TRUE and MODIFY also… and when making some changes sometimes you need to track those inserts and change them for using your validation code… Regards, Alfonso Pertierra (Spain)apertierra@teleline.es