Subject | [IBO] Re: IB_Query remains in EditMode after Posting |
---|---|
Author | andygarneruk |
Post date | 2004-02-16T00:55:49Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
fields defined in the master table. At the moment I think the reason
the secondary update (from within AfterPost) fails is a problem with
IBO (or perhaps the design of my app).
The core of TIB_Dataset.SysPost is essentially:
1 if not IsPosting
try
2 IsPosting := True;
3 SysBeforePost;
4 SysExecPost;
5 SysUpdateState
6 SysAfterPost;
finally
7 IsPosting := False
end;
When the AfterPost event is invoked at line 6, IBO still has the
dataset as 'IsPosting'. Hence the secondary update attempt (from
within the AfterPost event) is forestalled at line 1, even though the
dataset's state is then dssBrowse (line 5).
Best regards, Andy.
> At 11:39 PM 15/02/2004 +0000, you wrote:wrote:
> >--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...>
> > > At 02:26 PM 15/02/2004 +0000, you wrote:AfterPost
> > > >I am attempting a secondary update to a dataset in its
> > > >event.example,
> > >
> > > Why?
> > >
> > > Helen
> >
> >The dataset is a master (sales order) with two details (1=order
> >items; 2=percentage commission payable to agents). When, for
> >an additional item is added to the order, the order value (storedin
> >the header) changes. The commission due to each agent then needs tosales
> >be re-calculated, and the total reflected in the margin (=total
> >value less total costs, less total commission) - these totals areor
> >also stored in the master.
> >
> >I detect a change to any of the totals in the BeforePost of the
> >master, and hoped to use this to trigger a re-calclation of the
> >others in the master's AfterPost.
>
> So - are these calculated fields in the app? or are they computed
> run-time columns from the database?database) then
>
> It matters...if they are calculated (and not stored in the
> you shouldn't be trying to push them into the Post event at all(before or
> after).There are no calculated or computed fields - they are all database
>
> Helen
> >
fields defined in the master table. At the moment I think the reason
the secondary update (from within AfterPost) fails is a problem with
IBO (or perhaps the design of my app).
The core of TIB_Dataset.SysPost is essentially:
1 if not IsPosting
try
2 IsPosting := True;
3 SysBeforePost;
4 SysExecPost;
5 SysUpdateState
6 SysAfterPost;
finally
7 IsPosting := False
end;
When the AfterPost event is invoked at line 6, IBO still has the
dataset as 'IsPosting'. Hence the secondary update attempt (from
within the AfterPost event) is forestalled at line 1, even though the
dataset's state is then dssBrowse (line 5).
Best regards, Andy.