Error mesage

Discussions about CSEntry
Post Reply
Mr.sharipov
Posts: 12
Joined: March 31st, 2016, 3:30 am

Error mesage

Post by Mr.sharipov »

how to display a message when the field is a numeric type blank? not a system error "out of range"
Saint
Posts: 63
Joined: November 22nd, 2013, 4:59 am

Re: Error mesage

Post by Saint »

Can use this code:

Code: Select all

if var = notappl or missing then "type error message to display here"; endif;
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Error mesage

Post by josh »

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;
Mr.sharipov
Posts: 12
Joined: March 31st, 2016, 3:30 am

Re: Error mesage

Post by Mr.sharipov »

Thank you, but this code does not work. When you leave the type of numerical empty leaving a message "ot of-range"
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Error mesage

Post by josh »

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.
Post Reply