Re: Where best to validate multi-row block

From: Roy Munson <mtproc_at_yahoo.co.uk>
Date: 26 Jul 2004 03:47:30 -0700
Message-ID: <853055e7.0407260247.320beb34_at_posting.google.com>


[Quoted] [Quoted] Hi Guys....neither of these solutions works as the data has not been posted to the database. So for example in the parent block i enter 10. In the multi-row child i enter one row with the value 6 and a second row with the value 5.

In a pre-commit the data has not been posted to the database so the validation of summing the child details will return zero each time. Data then get committed and you have a summ of 11 stored where the top block stated 10 to be the total value allowed.

For when-validate-item....this is pretty much the same.

The validation needs to be after data posted but before commit transaction completed.

Anybody got any clues...this must be a fairly regular scenario.

TIA Daniel Morgan <damorgan_at_x.washington.edu> wrote in message news:<1090639872.898451_at_yasure>...
> Jerry Alan Braga wrote:
>
> > I use pre-commit trigger. It will allow global validations for anything in
> > your form. If you raise form trigger failure then the whole commit process
> > is stopped. And this is before any of the internal pre-post checks of forms
> > against the database.
> >
> > What I have done is created a generic pre-commit trigger at the form level
> > and from there call a function called form_validate. If this function
> > returns false then the pre-commit trigger fails out, by default the function
> > returns true.
> >
> > By doing it this way I can have a standard template form in which any
> > developer can override their own local copy of function form_validate and
> > insert specific form level checks.
> >
> > "Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message
> > news:1090543259.802979_at_yasure...
> >
> >>Roy Munson wrote:
> >>
> >>
> >>>Hi,
> >>>
> >>>Have a 2 block parent child form....the child block is multi row in
> >>>which a number of pieces can be entered for each row.
> >>>
> >>>A total value is entered in the parent block....am wanting to validate
> >>>that the sum of the numbers entered in the child block does not exceed
> >>>the value entered in the parent block.
> >>>
> >>>Where is the best place to put the validation? PRE-INSERT is no good
> >>>as data still not posted. POST-INSERT no good as its too late for
> >>>validation to fail and rollback.
> >>>
> >>>Any help appreciated
> >>>
> >>>Roy
> >>
> >>I use WHEN-VALIDATE-ITEM.
> >>
> >>Daniel Morgan
>
> I like it.
>
> Daniel Morgan
Received on Mon Jul 26 2004 - 12:47:30 CEST

Original text of this message