Re: Forms4.5 HELP !!!
Date: 1997/11/04
Message-ID: <345F9ACE.549A_at_stibo.com>#1/1
Andrew M. Balshem wrote:
> We've a very simple forms 4.5 application (10 fields). ID and SPECIES
> fields cannot be null. I've a trigger on both fields to make certain
> that neither are null.. When I enter the form my first enterable
> field is ID and the cursor is placed there. If I click anywhere
> prior to entering the ID I receive an error (that I must enter ID) as
> I should. However, after I've entered ID if I use my mouse to skip
> over the SPECIES field I don't get a similar error unless I've first
> entered the SPECIES field. I've tried using each of the WHEN-MOUSE...
> triggers to no avail. I do have a pre-insert/update trigger that
> checks that both fields are not null & these do prevent commiting bad
> data to the database. I would, however, like to write a trigger to
> immediately inform the user that SPECIES cannot be null whenever
> they've used a mouse to skip over the field. Any solution?
Welcome to the world of graphic interfaces. If only the users didn't have that mouse...
Your problem is that your trigger (probably a When-Validate-Item trigger on the Species-item) doesn't fire, because you have made no changes to that field. I would consider this desirable in most cases, since applications that are too demanding about data entry order can be tedious. However you can accomplish what you want in different ways. One way is to create a "when-new-item-instance" trigger on the BLOCK level, with code like this (I assume all your fields are in one block, if not just add a when-validate-record trigger to check that the 2 fields are not null. This will fire when you leave the block):
if :system.trigger_item != 'MYBLOCK.Id' and
:system.trigger_item != 'MYBLOCK.Species' then
- It's not one of the required fields. Check if they are OK by now if :MYBLOCK.Id is NULL or :MYBLOCK.Species is NULL then message('Id and Species fields must be entered first!'); raise form_trigger_failure; end if; end if;
That should do it, as long as Id or Species is the first enterable field and that you don't navigate around in a when-new-form-instance trigger or the like.
Good luck.
--
------------------------------------------------------------------
Claus Jensen The Stibo Technology Group...since 1794
Stibo Datagraphics Inc.
400 Franklin Road E-mail: cje_at_stibo.com
Marietta Phone: (001) 770 425 3282, ext. 197
GA 30067-7735 Fax: (001) 770 425 3012
------------------------------------------------------------------
"If the human brain was simple enough for us to understand,
we would be so simple we couldn't..."
------------------------------------------------------------------
Received on Tue Nov 04 1997 - 00:00:00 CET
