Subject Re: [IBO] Re :Re: Before Post event not triggered
Author Helen Borrie
At 07:47 AM 11-10-01 +0000, you wrote:
>When it comes to the line customer.post, an f7 step in goes to the
>tibodataset post procedure, rather than the before post. At the line
>'inherited Post;' I get the error 'field customer must have a value'.
>The customer field is assigned in the before post event.

OK....that does seem wrong to me, too. (I _never_ use tables so I have not bumped into it.)

For assigning a primary key, use GeneratorLinks if you are using a generator; or put your routine to calculate a PK into the BeforeInsert handler. BeforePost is not the right place to do it, anyway, because you don't want this code to fire on updates or deletes.

As for intercepting Post errors and exercising a cancel (or abort) option on invalid data, the OnPostError event might serve your purposes better. Even better would be to put your error handlers into the TIBODatabase's OnError handler - that way you don't have to worry about it on your individual datasets.

regards,
Helen



>
>--- In IBObjects@y..., Helen Borrie <helebor@d...> wrote:
> > At 07:25 AM 11-10-01 +0000, you wrote:
> > >Hi
> > >
> > >I have done a conversion from ttables to tibotables. My ttables
>had
> > >before_post events. When doing a post with tibotable, the
>ibodataset -
> > > tibodataset.post procedure kicks in and does the post. Hence my
> > >before post event does not happen - In certain cases this is where
>I
> > >decide to assign the key field value (required) / or cancel the
> > >record.
> >
> > What makes you think BeforePost is not firing?
> >
> > Helen
> >
> >
> >
> > >What to do ??
> > >
> > >
> > >
> > >
> > >
> > >Your use of Yahoo! Groups is subject to
>http://docs.yahoo.com/info/terms/
> >
> > All for Open and Open for All
> > InterBase Developer Initiative · http://www.interbase2000.org
> > _______________________________________________________
>
>
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

All for Open and Open for All
InterBase Developer Initiative · http://www.interbase2000.org
_______________________________________________________