Noor Jahan
28th April 2015, 13:13
Hi All,

Whats the difference between these two codes.

1:message(There is an errror)
set.input.error("")


2: set.input.error(there is error msg)


i want to know whats the difference in between directly using error messsage in set.input.error() and using a blank string in set.inout.error (")and then displaying the error in message() function.

mark_h
28th April 2015, 15:00
As far as I know there is no difference - except if you want one statement you have to go define a message. Then you have 1 code statement versus 2. We typically do not do it - we just use message and set.input.error. Never really thought about this before.

bhushanchanda
28th April 2015, 16:30
Hi,

You can use message() in combination of other things as well -

e.g.

field.field_name:
check.input:
message("Your error message")
input.again()

choice.choice_name:
after.choice:
message("Your error message")
choice.again()

I guess this will do the same thing and will return the control to your form again.

mark_h
29th April 2015, 01:18
I think if you read input.again and set.input.error you will see they kind of do different things. With set.input.error it actually runs to the end of the event before actually asking the user to input again. That is why sometimes if you have multiple checks that fail you will get multiple messages before it asks you to input the field again.

Noor Jahan
29th April 2015, 05:42
Thanks Mark and bhushachand.....:)

manish_patel
29th April 2015, 12:51
if error appear during AFS, and if you have written message("abc") & set.input.error("") you wan't get error message in reference variable, set.input.error("@abc") will do it.

This is not true Sachin!!