Re: Forms questions.. Help please

From: Bob Cunningham <bcunn_at_oanet.com>
Date: 1997/12/06
Message-ID: <3489a9cc.142539382_at_news.oanet.com>#1/1


On Sat, 06 Dec 1997 16:11:59 -0800, Jimmy <c6635500_at_comp.polyu.edu.hk> wrote:

>Hello all,
>
> I have some problems in FORMS 4.5:
>
> 1) When I press a button which has the following code:
>
> go_block('A');
> create_record;
> go_block('B');
> create_record;
>
> A message "FRM-40102: Record must be entered or deleted first"
> Why such message displayed and how to hide this message?

One reason could be that there are one or more fields marked as "Required". Attempting to navigate from the record in block 'A' fails due to the absence of the required information. You could have your code assign appropriate default values or enter appropriate default value properties for all the necessary fields. The result is the two created records are valid and marked for insertion, so, assuming these are base table blocks, the rows would be inserted into the database should COMMIT_FORM ever be issued.

>
> 2) When a user press the query button, the FORM is in ENTER-QUERY mode.
>When the user press Ctrl-Q now, the FORM can cancel the query. My
>question is, I want some actions is associated with the Ctrl-Q, so what
>is the trigger name?
>

You could use the appropriate KEY-xxxxxx triggers to perform stuff you'd like to do when Enter Query or Execute Query or Exit key actions occur. These triggers can fire even if your own code wants to Enter Query mode or Execute a Query or exit, providing your code uses the DO-KEY(...) built-in to perform those actions.

> 3) I want to do some checking in the text-item A with Post-Text-ITEM.
>After checking, if checking fail, I want the focus is still in the
>text-item A. So I use go-item('A') if fail. However, go-item is invalid
>in the Post-Text-Item trigger. How can I go to the same item A if
>checking is failed? (i.e. when the user leave the item A, I want to do
>checking. If checking is failed, go back to the same item A)
>

Issue RAISE FORM_TRIGGER_FAILURE. Another trigger that is commonly used for this activity is When-Validate-Item, which is fired when the user leaves the item but only if the item has been changed and has not yet been validated (i.e. marked as valid). Same approach...if something is wrong and you wish to have the navigation stopped, then raise the trigger failure exception.

>Thanks,
>Jimmy

Bob Cunningham
bcunn_at_oanet.com Received on Sat Dec 06 1997 - 00:00:00 CET

Original text of this message