Error mesage
-
- Posts: 12
- Joined: March 31st, 2016, 3:30 am
Error mesage
how to display a message when the field is a numeric type blank? not a system error "out of range"
Re: Error mesage
Can use this code:
Code: Select all
if var = notappl or missing then "type error message to display here"; endif;
Re: Error mesage
You don't want "missing" in the check. If a numeric field is blank the value in logic will be "notappl". Missing is used when you have a special code designed in the value set for missing, not for blank fields. Also you need to use errmsg() to show the message.
if var = notappl then
errmsg("type error message to display here");
endif;
errmsg("type error message to display here");
endif;
-
- Posts: 12
- Joined: March 31st, 2016, 3:30 am
Re: Error mesage
Thank you, but this code does not work. When you leave the type of numerical empty leaving a message "ot of-range"
Re: Error mesage
The out of range if from the system built in range check which does not allow blank (notappl) if you are in system controlled mode. You can turn this off using the set behavior statement:
set behavior(MYVAR) canenter(notappl) on (noconfirm); // turn of blank check for field MYVAR
or
set behavior() canenter(notappl) on (noconfirm); // turn of blank check for all fields
Note that some people using system control mode prefer to use a missing value instead of blank to make is easier to distinguish between fields that the user left blank and fields that were skipped using the skip statement which are also set to notappl.