Re: Forms 4.5 - Check the presence of a field

From: Bob Cunningham <bcunn_at_oanet.com>
Date: 1998/04/19
Message-ID: <353946a1.24243071_at_news.oanet.com>#1/1


On Fri, 17 Apr 1998 22:38:16 +0100, "Darren Palmer" <D.R.Palmer_at_btinternet.com> wrote:

>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)

Using a timer is a common approach to scheduling restricted built-ins to be executed from within triggers that restrict their use, but, since you don't wish to employ that technique, another approach for scheduling this navigation could be used.

In the When-Validate-Record trigger save the name of the item that you wish to navigate to in an area that is available to other trigger code. The item could be saved in a package specification variable or a non-table item in one of the blocks (preferably a control block). The When-Validate-Record trigger can then issue a message to inform the user of the problem and raise an exception.

Add a When-New-Item-Instance trigger whose job is to interrogate the item name save area. If an item name is present, then the trigger fetches the item name, clears out the save area and then issues a GO_ITEM to that item name. If an item name is not present, then it does nothing.

The when-new-item-instance trigger will fire after the when-validate-record trigger raises its error and move the cursor to the desired item. The item should be within the same block, otherwise, the navigation attempt will fire the when-validate-record trigger again causing it to fail once more (a bit of a loop).

>
>Thanks in advance
>
>dazzler_at_btinternet.com
>
>Darren
>
>

Bob Cunningham
bcunn_at_oanet.com Received on Sun Apr 19 1998 - 00:00:00 CEST

Original text of this message