Re: Forms4.5 Duplicate Recs in block
Date: 1997/11/18
Message-ID: <01bcf3d7$21758780$38f11286_at_itwol-pc3963.itwol.bhp.com.au>#1/1
Tracey,
The 'Post' built-in is one option.
Posted transactions reside in the database for validation purposes, but are
visible only to the current session. The main side-affect is that issuing a
Post resets the Record/Block/Form status back to 'Query_Status'. Instead of
checking the Status to prevent some undesirable action you must instead
control this programmatically (set/reset a flag). Another feature is that
Forms outputs a message, which can be suppressed by setting
:System.Message_Level to 5.
Post is a restricted built-in, which means using a When-New-Record-Instance
trigger.
One other issue you may need to consider is that the number of Posted but
uncommitted transactions can build up over time, and that these are
invisible to other users in a multi-user environment. A Timer could be used
to manage this problem, and prevent significant loss due to system outage.
There are other options to check for duplicates:
- Maintain a record group of key values for all transactions (between
commits)
- Navigate through the block checking against all other rows
- Commit all transactions to a "temporary" table and flush to the permanent
table when the user "commits".
These options may also require validation against the d/b and special handling of deletes.
An alternative, since values are populated via LOV, is to alter the LOV's Record Group at run-time, as selections are made. I haven't tried this or thought it through, but it may work.
The best option depends on your application, number of rows involved, need to validate against previous selections in the database, stability of your environment, etc.
Tracey Berukoff <tlberukoff_at_boco.co.gov> wrote in article
<3470DF5F.55C9_at_boco.co.gov>...
> Can I catch a duplicate entry in a block if multiple records are entered
> without a commit? My block is multi-row and I don't want the user to
> have to commit each record before entering another. Values are
> populated
> via an LOV.
>
> ie: value A
> value B
> value A <==== ERROR, DUPLICATE VALUE
>
> Thanks in Advance!
> Tracey
>
Received on Tue Nov 18 1997 - 00:00:00 CET