wjfisch
17th February 2003, 17:16
I have problems calling in a 'check.input' section 2 different set.input.error() messages. In the program there's a possibility that both error messages should apear. In this case only the last one is shown as a popup window. Why ???
evesely
17th February 2003, 19:30
From the set.input.error() description (http://www.baanboard.com/programmers_manual_baanerp_help_functions_message_handling_set_input_error):
The error message is displayed after the entire section has been executed. Consequently, you cannot display two error messages with this function.
If you really want to display multiple errors, then you might consider the following:
Create a boolean variable that is true if an error is reached
Set the boolean to false at the beginning of the check.input section
When an error message should be given, use mess() or message() instead of set.input.error. Also, set the boolean to true.
At the end of check.input, do set.input.error("") if the boolean is true.
Of course, this can get a bit tricky if you use standard function calls that do set.input.error() themselves. However, in a simple situation, this should work for you.
Good luck.
NPRao
17th February 2003, 20:08
Here is an example -
field.user:
before.zoom:
process.zoom()
check.input:
user = shiftl$(strip$(user))
if isspace(user) then
err.stat = 1
err.mess = "zmadms0009" |* Please enter the value for this field
endif
if not err.stat and not tt.user(user, name)then
err.stat = 1
err.mess = "zmadms0028" |* Error - user not found
endif
if not err.stat and check.super() then
err.stat = 1
err.mess = "zmadms0030" |* BaaN Super User cannot be deleted
endif
if err.stat then
set.input.error(err.mess)
endif
display("name")
wjfisch
18th February 2003, 12:47
Thank you for your help !
Greetings,
W. Fischer