Subject | Re: [IBO] I dont want to see the record by postretain |
---|---|
Author | Helen Borrie |
Post date | 2003-12-05T11:04:14Z |
At 07:00 PM 5/12/2003 +1100, you wrote:
before they are entered into the database, yes?
the rest of the original message intact. Usually it is "bad netiquette" to
do this, but, (as usual) it is difficult to get sufficient information from
you. Hence the choice to keep the little amount of information you provided.
design choice) then you need to check for duplication *before* you let the
application try to insert anything. Write a CheckInvoiceNumber method that
queries the database to check this.
Don't allow the user to enter the invoice number into the table: provide a
non-data-aware input field. Pick up the entered string and pass it to your
CheckInvoiceNumber method. Call CheckInvoiceNumber *before* you allow the
dataset to go into Insert mode. It can be a TIB_DSQL that executes a SP
and returns True or False as an output parameter. If it returns True, you
can tell the user that the invoice already exists and go no further. If it
returns False, it's OK, and you can pick up the Invoice number from the
TEdit in the BeforeInsert handler and assign it read-only to your column.
Helen
>At 04:00 PM 5/12/2003 +0800, you wrote:You replied that it is printed on the invoice. So - printed invoices exist
> >Good day.
> >
> >I have another problem. =( .
>
>Lots of problems here. This is NOT a good design.
>
>
> >I have a mater detail setup in my application. I want to perform a check
> >first before saving the records to prevent duplicate entry of invoices.
>
>Why?
>
>Begin by saying where you are getting the invoice number from.
before they are entered into the database, yes?
>I'm top-posting this so I can keep the rest of your description togetherTop-posting is replying to a message by typing at the beginning and leaving
>with this.
the rest of the original message intact. Usually it is "bad netiquette" to
do this, but, (as usual) it is difficult to get sufficient information from
you. Hence the choice to keep the little amount of information you provided.
> >So in the master dataset before post i have something like thisIf you are using the invoice number as the primary key of the table (a bad
> >
> >if masterdataset.state = dssinsert and not masterdataset.ispostretaining
> >then
> > // search for possible duplicate records code is here
design choice) then you need to check for duplication *before* you let the
application try to insert anything. Write a CheckInvoiceNumber method that
queries the database to check this.
Don't allow the user to enter the invoice number into the table: provide a
non-data-aware input field. Pick up the entered string and pass it to your
CheckInvoiceNumber method. Call CheckInvoiceNumber *before* you allow the
dataset to go into Insert mode. It can be a TIB_DSQL that executes a SP
and returns True or False as an output parameter. If it returns True, you
can tell the user that the invoice already exists and go no further. If it
returns False, it's OK, and you can pick up the Invoice number from the
TEdit in the BeforeInsert handler and assign it read-only to your column.
Helen
> >
> >I use the invoice no as search criteria in searcing for the duplicate
> >records ... what happen is since ther is a postretain that happen when a
> >detail dataset record was post. the search for duplicate records result
> >to finding the current invoice since it was postretain ... how could I
> >able to do such things that my search wont see the post that was retain?
> >
> >As of now the solution that I have is to use a different transaction for
> >searching the duplicate since it is not yet committed but I feel it is a
> >long solution ... There might be a short solution I guess from you
> >experts =)
> >
> >James
> >
> >
> >
> >
> >___________________________________________________________________________
> >IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> > without the need for BDE, ODBC or any other layer.
> >___________________________________________________________________________
> >http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> >keyword-searchable FAQ, community code contributions and more !
> >
> >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>___________________________________________________________________________
>IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
>___________________________________________________________________________
>http://www.ibobjects.com - your IBO community resource for Tech Info papers,
>keyword-searchable FAQ, community code contributions and more !
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/