kuldeepsharma
14th June 2008, 17:33
Hi All,
I have just started using LN 6.0
i have customised a new table.
on the UI script I am using check.inut section for validating data.
but it is checking Only once i.e.
First time is check the data and displays the error.
but if i input invalid value again system jumps to next field. where as it should not jump, it whould fire again the error. I don't know why it is happning.
I have not used DAl script for this table.
following is the code:
field.tduni003.cuno:
check.input:
select tccom100.bpid from tccom100
where tccom100._index1 = {:tduni003.cuno}
as set with 1 rows
selectdo
selectempty
message("Wrong Customer")
set.input.error("",e)
endselect
can some pl help me on this
thanks
vik.patil
16th June 2008, 11:17
Instead of check.input use after.input, it will work
kuldeepsharma
16th June 2008, 12:06
thanks for your reply sir
but it is always advisable to use check.input
becuz this event is also fired when save is clicked
this way it also checks if user tries to save the record without inputing data in every field.
This event works very well in baan 4c4,
i don't know why its not working in baanerp ln
satish_pabathi
4th August 2008, 15:33
you need to use choice.again() as well in order to get the cursor on to the same field .
mark_h
4th August 2008, 15:52
I do not think choice.again is the answer. I would expect LN to act like 4c4 in this case. It sounds like LN only executes the check.input the first time data is input, when it should fire each time incorrect input is entered. I do not know LN, so I really do not know an answer to the question.
shah_bs
4th August 2008, 20:04
The set.input.error() is failing because you have provided an argument (e) for which it does not find a matching format. [I am not sure, but there should have been an error message logged in the log.bshell file]
Try as follows:
message("Wrong Customer: " & str$(e))
set.input.error("")
(I would have hoped for this to be caught at compile time - I guess next version.)
NPRao
4th August 2008, 20:30
message("Wrong Customer: " & str$(e))
set.input.error("")
Refer to the Tools Programmer's manual for the proper usage of - set.input.error() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_message_handling_set_input_error)
falcazar
21st May 2009, 17:37
Hi, I have the same problem and I can't found the solution, ¿do you find the solution? if is true, ¿can you said me why happend this?
thank you a lot.
FA
Marioth
21st May 2009, 18:05
Please post your script, so we can analyze it.
falcazar
21st May 2009, 18:13
ok, it is.
field.tccom112.crat:
check.input:
select tfacr951.*
from tfacr951
where tfacr951._index1 = {:logname$, :tccom112.crat}
selectdo
selectempty
set.input.error("tccom91120")
endselect
the script type is : script database manager (the first option) I don't know what happend. then you for you help.
greatings,
Marioth
21st May 2009, 18:17
Well I am using LN but for what I know is before you do anything like update or print something do you have a check.input() that should pick it up elsewhere put it in a after.input and say input.again().
Hope this helps.
falcazar
21st May 2009, 21:46
well, that's sound correct but i don't understand why not send me the error message. Well I traying do your suggestion and said you what happend. thank you I reply the results in a few minutes. when you validate a field after the input, you use this form that you recommender me?
falcazar
21st May 2009, 21:58
I test your sugestion and in the script is true to pass in the section that i put but not send me the message and not blocked the intro, in resume can't validate if one data is true or false. I hope more suggestion.
Marioth
22nd May 2009, 11:01
Please forward your script to analyse cos this is strange.
kuldeepsharma
23rd May 2009, 14:41
Dear Falcazar,
Actually I hav not fond any solution till now.
But, Since if any validation is put in a check.input section.
All the check.input were again fired automatically by the system before db.update, and that time it does not allow the records to be saved until condition is true. So my record never saved before validation. hence I don't have any problem with it.
So I am living with the problem but my work is not being hampered.
As for as input.again() and choice.again() goes.
Input.again can only be used in after.input section. So if the user bypass a particular field by not entring any data, validation is also by passed.
So wrong entry can be saved. hence it is not advisable.
And choice.again can only be used in choice.sections not in field sections.
hope this has clerified the issue somewhat to you.
ashu2814
29th May 2009, 13:06
use after.input:
in that use input.again()