[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== Error trap (OpenInsight 32-bit Specific) ==== === At 02 OCT 2003 05:36:47PM Armando Moreno wrote: === {{tag>"OpenInsight 32-bit Specific"}} 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 [url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url] [img]http://www.srpcs.com/srpicon1.gif[/img] ---- === 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 # '' Then STATUS() = Valid$ If Conversion=ICONV' Then If Iconv(Ans,'D')=' Then Void= 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 # '' Then Return_Data = @USER0 End Status() = Invalid_NoMsg$ End Else Return_Data = Ans End End Else Return_Data = Oconv(Ans,Branch) End End 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. [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=E910BFA7DFAE12E185256DB30076B9B0|View this thread on the forum...]]