Re: Forms 4.5 insert validation question
Date: 1997/06/19
Message-ID: <01bc7cf4$55c57680$6a6b5ecf_at_ehall.bcg.com>#1/1
This actually won't work because you'd need a post first. Otherwise, if the user entered in a master record, and then went to the detail block and entered in three detail records and then saved your method would prevent it. It would look up the database value and search for the linking columns that are on your form but have not yet been saved(or posted) and it would return count 0.
Another solution would be to simply from a key-commit trigger go to the detail block and check if there are records there. Again, this may not be elegant (it also requires that all of your programmatic saves in your code are do-key(commit)), but it will work.
Hope this helps (and that I understood the problem correctly)
Eddie
Bob Acker <program_at_icanect.net> wrote in article
<33A17A3D.195F_at_icanect.net>...
> You can add code to the trigger in your form attached to the save button
> or save menu choice to do a select count keycol from the detail table
> where
> linking col = linking col. If the count is 0 then raise form triger
> failure.
> This will prevent the save.
> Else allow the do_key('commit_form').
>
> This isnt elegant, but it should work.
>
> David-Michael Lincke wrote:
> >
> > I'm rather new to Forms development an have a problem concerning input
> > validation for detail records in a 2 block master-detail form which I
just
> > can't seem to find a solution for. So here goes:
> >
> > A 2 block master-detail form (orginally generated using Designer/2000;
the
> > detail form is an interesection table, so its fields are not shown and
are
> > populated through an LOV from a lookup detailed table usage), the
master
> > block only shows a single record at a time and allows for query,
insert,
> > update and delete; the detail block also allows for query, insert,
update
> > and delete but shows 6 records at a time (populated through LOV).
> > Now what I want to accomplish is that a newly created master record
cannot
> > be saved without there also being at least one related detail record
being
> > created. What's the best approach to take here? Any help is
appreciated.
> >
> > dave
> >
> > --
> > David-Michael Lincke
> > Research Assistant
> > Institute for Information Management IWI-HSG, University of St. Gallen
> > EMail: David-Michael.Lincke_at_iwi.unisg.ch, dlincke_at_bandon.unisg.ch
> > URL: http://www-iwi.unisg.ch/about/team/dal.html
>
Received on Thu Jun 19 1997 - 00:00:00 CEST