Re: Oracle Forms 6 : Best way to do multiple row validation ?

From: Tiago Rocha <please.see.link.at.signature.for.email.address_at_zaz.com.br>
Date: Mon, 14 Jun 2004 15:32:20 -0300
Message-ID: <adrrc0l6c68hdbodjfjdri6nivgqnncpb7_at_4ax.com>


On 11 Jun 2004 14:26:16 -0700, thatsamiam_at_yahoo.com (Sam Iam) wrote:

>It sounds like the Key-Commit method you mention would be similar to
>post-forms-commit and not fire right after a user leaves the data
>block.

I did the kind of validation you want on a When-Validate-Record trigger. I don't know if there are easier ways, but here go the way I did: I created a record group on the when-new-form-instance. On that form, there are controls to make sure the record group reflects exactly what's in the block, per example, on the key-clrblk (clear block) trigger, there are code to clear the record group. Okay, so, when the when-validate-trigger fires, I did a loop through the record group to check if the data the user is entering conflicts with the data in any row of the record group. If there is conflict, I show a warning, if not, there goes another row on the record group... You can try this using a post-block trigger instead of the when-validate-record. Both triggers does not accept restricted built ins, so you can't do a "first record - loop - exit when system.last_record = true" thing, but with record groups you can.

hope this helps, good luck!!!

-- 
Tiago Rocha
Recife - Brasil
www.diariodastrilhas.cjb.net
Received on Mon Jun 14 2004 - 20:32:20 CEST

Original text of this message