jcook331
10th November 2004, 17:56
I have a session that I am zooming to from a standard Baan session. Upon zooming to this session most of the fields are automatically populated with the values from the Baan session. This leaves two fields to be entered by the user. I do this by importing the values from the baan session and doing a db.insert. The field I want to be mandatory input for the user is a 3 character string field. I put in a check.input section and go to a table to make sure the user's input is valid. I don't want this field to be left blank. However, if you zoom to this session and just save and exit without entering anything in this field, the record is saved and no error message is given. It's like the check.input session is skipped. If you actually enter incorrect data then the error message is given. If you enter three blank characters no error message is given. It is as if it doesn't see a blank field as an error. I have even tried forcing incorrect data into the field on the zoom, but when you save and exit the incorrect data is saved and no error message is given. This is a Type 1,2,3 form so the check.all.input section should automatically be executed. I don't know why it doesn't see blanks as an error.

Is there any way to force the check.input section to be executed on a save command? Why doesn't it see a blank field as an error?

Thanks for any help with this,
Jason

mark_h
10th November 2004, 19:20
My guess is that when you zoom you insert the record. Then pressing the save and exit key really does nothing, because nothing new was input. If I understand what you are saying you insert the record automatically. The check.input is only executed when the session actually thinks something changed in that field. You can try forcing a check.all.input on the save and exit event. I have never tried it there, but I do have several programs that I verify data before letting the users exit the program.

Mark

malutz
11th November 2004, 08:42
I would take the same proach as Mark. Verify that the field is not empty and does not contain spaces


if not isspace(<field>)
then

csecgn
11th November 2004, 13:14
Maybe its better not to insert the new record directly. Try execute(add.set) at start of your session and populate your variables in the before.choice of the add.set. So the user has no way to save your record without the check.input-section.

regards
csecgn

jcook331
16th November 2004, 22:16
Thanks for all the help. I was able to force the check by using the choice end.program. I performed the check for a blank field in the before.choice and used choice.again() to keep them from exiting without entering something in the field. I think the other suggestions would have worked as well. Thanks again.