Field Validation

I have a formula in the “field validation” option of a form.@If(FieldValue0 = “SS Mileage” & FieldValue5 != FieldValue4 & FieldValue6 = “”; @Failure(“You must enter a reason/description for the non-default mileage amount”);@Success)

FieldValue4 is a computed Number field

FieldValue5 is an editible Number field

If I enter the same number it still doesn’t pass validation. FieldValue6 is not required if the two numbers do match. Why is this not working?

Subject: It appears to be working.

I created a simple test, entered “2” for fieldvalue4 and if I entered a 2 in fieldvalue5, I was not prompted, but if I entered anything other than 2, I’m prompted for a reason.

All of my test fields are text. Perhaps you need to convert one of your fields to text in order to compare the values??

Subject: More testing…

I changed fieldvalue4 and fieldvalue5 to number fields and entered a 2, not “2” in fieldvalue4 and it works.

What is your computed value for fieldvalue4?

Subject: RE: More testing…

FieldValue4 is a mathematical formula multiplying a previous lookup number * .4

Subject: Try this…

Hard code a number in fieldvalue4 and test. If it works, you’ll know what the check.

Subject: RE: Try this…

That didn’t work either

Subject: Hmmm…

I set up the test, I believe, as you described and it works. Fieldvalue4 is computed (number). Hardcoded 2.

Fieldvalue5 is editable (number).

Fieldvalue0 is computed and contains the value you specified.

Fieldvalue6 contains the validation check.

It the test set up correctly?

Subject: RE: Hmmm…

Ok…hardcoding a number in FieldValue4 works. Why won’t it work with a result from a formula?

Subject: Try adding…

Try adding this to @If formula: FieldValue4 != “”;

@If(FieldValue4 != “” & FieldValue0 = “SS Mileage” & FieldValue5 != FieldValue4 & FieldValue6 = “”; @Failure(“You must enter a reason/description for the non-default mileage amount”);@Success)

Subject: RE: Try adding…

This didn’t work either…

Subject: Just a thought…

I have seen some floating point problems in the past, where it appears that the result of a formula is 4, but in fact it is 4.000001

You have a new feature available in R6, look at:

@FloatEq

and see if that helps fix your problem.

Good luck.

Matt

Subject: RE: It appears to be working.

The problem appears to be comparing a computed field. If the fields are both editable it works. I need it to work with one of the fields being computed.

Subject: Field Validation

Another thing that may be causing the problem is the field validation is occurring in a dialog box so there is [@Command([ViewRefreshFields]) in the button calling the dialog box. Can anybody help me with this?

Subject: RE: Field Validation

You lost me know. Recommend you get the Input Validation field working first, then add other options. This way, you can determine where the error is occurring and resolve them one at a time.