Re: How to use sequences, and which trgger for "Execute_Querry'?

From: Frank <frankbo_at_interaccess.nl>
Date: Thu, 5 Oct 2000 11:01:04 +0200
Message-ID: <8rhg0u$nrq$1_at_porthos.nl.uu.net>


[Quoted] I would think this scenario over if I were you. I suspect -based on the scenario given- that ou will use a sequence to get a new cr_number. As soon as you select this, that number is given away. For ever. Also when the user decides not to input data, or rollback.

A lot of financial apps don't like holes in their number ranges, or rather, the accountants and taxmen don't like/don't allow it.

If the above resembles your approach, think it over. The "standard" approach in these cases would be to display the cr_number after committing.

--
Frank
Richard Hollingsworth <william.hollingsworth_at_hsv.boeing.com> schreef in
berichtnieuws 39DB585C.E5F891C5_at_hsv.boeing.com...

> Matt:
>
> I don't know if this will get to you or not, never replied to a sender
before.
>
> What I want to do is, when the user enters the form, it takes them to the
"NEXT"
> blank record, and shows the new sequence number in the CR_NUMBER field.
Each time
> the user presses the INSERT_KEY on the toolbar, I want to create a new
blank record
> and increment the sequence number and display it in the CR_NUMBER field.
>
> I'm guessing that this is kinda the standary interface a user would want
to see
> when entering a new form - to see the new cr_number (non-editable of
course) and
> then start entering data.
>
> Thanks for the reply and any help you might have.
>
> Thanks again,
> Richard Hollingsworth
>
>
> "Matt B." wrote:
>
> > "Richard Hollingsworth" <william.hollingsworth_at_hsv.boeing.com> wrote in
message
> > news:39D9FC2B.8EAF6817_at_hsv.boeing.com...
> > > Hi. Thanks for reading this.
> > >
> > > I have a sequence defined, and want it to increment by 1 each time I
add
> > > a new record. Well, what happens is, when the form comes up, no
records
> > > are visible. I have to manually press the 'execute_querry' button to
> > > get the old records to show up.
> >
> > Standard functionality.
> >
> > >When I do that, the records appear, but
> > > the sequence number has now doubled. Also, each time I press the
"next"
> > > or "previous" record button to review the old records, the sequence
> > > increments.
> >
> > That's because you have it in WHEN-NEW-RECORD-INSTANCE. As you land on
another
> > record, it fires.
> >
> > > So I think I have the "select cr_seq.nextval into
> > > :change_request.cr_number from dual;" statement on the wrong trigger.
> > > Which one should it be on? I have it on the
"WHEN-NEW-RECORD-INSTANCE"
> > > trigger for the block. I also tried the "WHEN-NEW-BLOCK-INSTANCE"
> > > TRIGGER. Same results.
> >
> > Depends on when you want to do it - can you be more specific? Do you
want it
> > for every record you commit to the database? Try POST-INSERT then. Do
you
> > want it for every record you enter even if you don't commit them? Then
do it
> > on WHEN-NEW-RECORD-INSTANCE with a "IF :SYSTEM.RECORD_STATUS = 'NEW'"
condition
> > around it. Or when you leave a record and go to another one? Try
POST-RECORD
> > or WHEN-VALIDATE-RECORD (depending on what you want) with a "IF
> > :SYSTEM.RECORD_STATUS = 'INSERT'" condition.
> >
> > Any other way you want to do it?
> >
> > > Also, where does the "EXECUTE_QUERRY" command go so it will auto. load
> > > the old records for the table when the form appears?
> >
> > WHEN-NEW-FORM-INSTANCE is a good place if your first navigable block is
the one
> > you want. Otherwise, preface it with a go_block(<blockname>); first
before you
> > execute the query.
> >
> > -Matt
>
Received on Thu Oct 05 2000 - 11:01:04 CEST

Original text of this message