Re: Forms4.5 Trigger when entering a character in a new record

From: Ken Denny <kdenny_at_interpath.com>
Date: 1996/12/10
Message-ID: <32AD7686.61FF_at_interpath.com>#1/1


Volker Hauswurz wrote:
>
> We have some master-details and we have to lock the master when we update the
> master, but also when inserting a detail for a master.
>
> I would like to know if there is a trigger which fires when you enter a new
> character in a field of a new record.
> Create-record and When-New-Record-Instance already fire when you navigate to a
> new record in the detail block.
> If you update a queried record the ON_LOCK trigger fires. So we search for a
> way to handle the situation when you enter the first character in a new record.
> Does anyone know a solution?
>
> Thanks
> Volker

There seems to be a concensus that you can't do this. However, I thought of a way it might be possible. Define the field with "Update Allowed" and "Insert Allowed" false and define an On-Error trigger associated with the item. The on-error trigger should fire when someone types a character in that field. Within that trigger you can do whatever it is you want to do when they enter a character, then do a
set_item_property(block.item_name_,updateable,property_true) and a set_item_property(block.item_name,insert_allowed,property_true) to allow inserts and updates. Then in the When_validate_item trigger for that item you can set the updateable and insert_allowed properties false again.

There may be one problem with this in that you may lose the first character you key into the field.

Disclaimer: I haven't tried this, I just thought about it and I think this may work.

Ken Denny
Insight Industries, Inc.
RTP, NC
kdenny_at_interpath.com Received on Tue Dec 10 1996 - 00:00:00 CET

Original text of this message