vaishali_sftdev
22nd May 2008, 09:12
Hi,
I want to reset the value of the field to what it had before displaying error message. In check.input event for that field i am checking for the valid value by calling a function from dll and whenever error comes then it changes to some random value and previous value is lost. Is there a function availble to reset the value in such scenario?
mark_h
22nd May 2008, 17:14
I use set.input.error("") all the time - without this issue. Is there something going on with this field in the DLL's? A quick check would be to just put the set.input.error() directly in the check.input.
There is attr.previous$ - you can look up help on this, but you should not need it.
vaishali_sftdev
29th May 2008, 20:50
Mark,
in DLL, value of the field is not changing.. In the script, i am checking value of month field in the check.input of year field. So, in this event if the month is not valid then i am doing to.field("month"). Now, whenever the month is found to be not valid then error msg ("Month is not valid") is shown and cursor goes to month field. In this case, the previous value of month field does not remain and it gets changed to some unexpected value. As u told to use attr.previous$, but this cannot be used in this case as i am checking for the valid value in the event of some other field. :confused:
mark_h
30th May 2008, 15:36
Can you post the code? Someone might see something to change and or try.
If the month field is a form field, then why not check if it is a valid month in the check.input of that? I guess I do not understand what is happening and what is on the form.
vaishali_sftdev
12th June 2008, 14:30
Mark,
you are correct. But, i have to check for the month and year combination existing already in the table or not. Thats why i have to keep all the validtions in the check.input section of year field.
In which one of the validation is for month field where i am checking valid month based on some condition. So, for this i have written a function in dll. As function returns false, then i am calling to.field("month") function to let user enter new values for month first and then for year.
Code:
field.ltcom003.year:
check.input:
if not ltcom.dll0001.check.valid.month(ltcom003.conf,ltcom003.mont) then
set.input.error("ltmsgcode00001","Billing Month is not valid.")
to.field("ltcom003.mont")
endif
whenever, this error occurs and cursor goes to month field. Previous value is not retained in the Month field and field contains some random value which was not input even.
mark_h
12th June 2008, 14:52
The in the before input of the month field set a variable like hold.month. Then right before the to.field command set the month field value equal to hold.month. You might also need to display the new month value before the to.field command.
vaishali_sftdev
14th June 2008, 06:20
I tried using another variale to hold its value but its not working as required.. :o