Error trap (OpenInsight 32-bit Specific)
At 02 OCT 2003 05:36:47PM Armando Moreno wrote:
In an Edit Table column I have date validation: (D) and Conversion: D4-
Scenario: An invalid date is entered, OI then displays its 'Data Validation Error' message, once the user clicks on OK I want to trap and perform some processing before the cell gets focus, ie: put back the original date in that particular cell (row,col).
Where and how can I trap this.
Thanks
At 02 OCT 2003 06:32PM Donald Bakke wrote:
Armando,
The SYSMSG event is *supposed* to allow you to do this kind of interception but we have not found this event to work as advertised. You might have to handle validation and restoration on your own through the POSCHANGED and LOSTFOCUS events of the edittable.
dbakke@srpcs.com
At 02 OCT 2003 07:28PM Don Miller - C3 Inc. wrote:
For a fact the Validation trap doesn't work as advertised. It would also be nice if the error reported the Control Name .. this has been a bugaboo since the year dot. You have to handle the trap yourself as Don B. reports. This is one of the reasons OI requires more code than AREV in a lot of places. Ditto for Required fields .. would be nice to know which field is required that is causing the "cough".
Oh, well, that's why it ain't an end-user tool.
Don M.
At 02 OCT 2003 09:25PM Bob Watson wrote:
Don
Maybe - but if you handle your lostfocus processing in a commuter module and your pre-write processing (eg. required fields detection) in another commuter module, this means you write it once and that's it. I find that OI often requires less code taking this approach.
Bob Watson
At 04 OCT 2003 11:56AM Justin Case wrote:
Or, you could write your own validation routine (copied from ZIP_FORMAT)….
Subroutine Date_Format(Conversion, Ans, Branch, Return_Data)
Declare Function Msg
Equ Valid$ TO 0 ;* Successful
Equ Invalid_Msg$ TO 1 ;* Bad Data - Print error message window
Equ Invalid_Conv$ TO 2 ;* Bad Conversion - " "
Equ Invalid_NoMsg$ TO 3 ;* Bad but do not print the error message window
Return_Data =
If Ans #
ThenSTATUS() = Valid$If Conversion=ICONV' ThenIf Iconv(Ans,'D')=' ThenVoid= Msg( @Window, Ans:" is not a valid Date." )* @User0 is the original value squirreld away by GOTFOCUS or POSCHANGED (or whatever works in the end ;))If @USER0 # '' ThenReturn_Data = @USER0EndStatus() = Invalid_NoMsg$End ElseReturn_Data = AnsEndEnd ElseReturn_Data = Oconv(Ans,Branch)EndEnd
Return
At 04 OCT 2003 04:01PM Richard Hunt wrote:
Justin,
I believe this UDC will not be called if the conversion is "ICONV" and the date entered is NULL.