Re: WHEN_BUTTON_PRESSED Trigger Firing Problem

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1997/03/15
Message-ID: <5gf965$oap_at_info.csufresno.edu>#1/1


In article <Pine.A32.3.94.970314131347.17076A-100000_at_umabnet.ab.umd.edu>, Mark T. Waring <mwaring_at_umabnet.ab.umd.edu> wrote:
>I have Developer 2000 with Forms 4.5. where I have a form with data fields
>and some buttons.
>
>In the WHEN_BUTTON_PRESSED Trigger for the EXIT button, I coded:
>exit_form(NO_COMMIT);
>
>In the WHEN_BUTTON_PRESSED Trigger for the CLEAR FORM button, I first
>assigned valid values to all of the required fields, i.e., :field:=1;
>Then I coded: clear_field(NO_COMMIT);
>
>Both triggers work fine, except when the cursor is sitting on an empty
>required field. Then they don't fire at all until a valid value is typed.
>
>There must be a way around this, but I sure don't know it.

Not sure what you mean by the clear_field -- it has no parameters. Do you mean clear_form? If you are using clear_form(no_commit), you are leaving rows locked on the server. Be careful! I always use clear_form(no_validate,full_rollback). If the user hasn't committed any changes before pressing clear, that's his/her choice.

In fact the no_validate option may be what you are looking for. I also use the same clear_form before exiting the form.

As another option, put a CLEAR_RECORD (and not clear_field) before the exit_form and before clear_form. I believe any changes to that record will be discarded (I'm not sure).

A third option, set the required field prop. to false everywhere, and enforce the required field elswhere, like in the when-validate-record trigger. This allows your user to tab around the record without those annoying messages.

Regards,
Steve Cosner Received on Sat Mar 15 1997 - 00:00:00 CET

Original text of this message