Re: Forms 4.5 - Check the presence of a field
Date: 1998/04/20
Message-ID: <1998042004392000.AAA19028_at_ladder01.news.aol.com>#1/1
>Hi,
>
>picture the scene, I have a form with various fields on it base and
>non-base table items.
>
> When the user attempts to commit the form I want the application to check
>the presence of some fields (dependant on values entered). If a certain
>field has not been entered then I want the cursor to move to the field and
>an error raised.
>
>I could put these checks in the When Validate Record trigger but restricted
>built-ins cannot be called from this trigger.
>
>Any suggestions (which don't use the when timer expired trigger)
>
>Thanks in advance
>
>dazzler_at_btinternet.com
>
>Darren
>
>
The process I have employed to handle this problem is to create a program unit
in the form, usually called something like ALL_REQUIRED_DATA_PRESENT, and
declare it a boolean. This function checks the data, generates and displays the
appropriate error message, and returns a TRUE/FALSE as appropriate. In the
PRE_INSERT and PRE-UPDATE triggers, call this function. If it returns FALSE,
raise FORM-TRIGGER-FAILURE.
The pre-insert/update triggers fire once for each changed row; if they fail the cursor will go to the offending row. This technique allows the user to decide when they are finished, rather than a timer.
Hope this helps.
Dan Received on Mon Apr 20 1998 - 00:00:00 CEST
