Hi, I am trying to have a message box to pop out if the user enters a negative figure for the user age. I got the script for the age working but cant seem to get the message box right. Help please:) (PS: new to FM)
The simplest way is to use the field's validation and allow only numeric values within the range of 0 to 100.
There are other ways, but this is the simplest. Those other ways include using a script trigger and checking the value onValidate
Often the buttons in the validation error dialog confuse users or don't permit the option that you want to use to correct the error.
Thus, you can also use OnObjectValidate to perform your own script to both error check and to provide user friendly ways to correct that error. With such a script, you can use either a custom dialog or a popover to display your message.
I am currently using a calculation field so I dont think I am able to use this method. But thanks!!
If you are using the calculation I gave you in another thread, the user shouldn't be able to enter the age, only the date of birth.
In the field options for your Date of birth field, go to the validation tab and then Validate by calculation and put this in there:
Self ≤ Get ( CurrentDate )
You can then display a custom message if the validation fails.
Retrieving data ...