Subject Re: [IBO] Dataset States and Master Detail
Author Jason Wharton
You need to make your code smart enough to recognize when a dataset is
involved in a master detail relationship and then have it examine both the
master and the detail dataset in order to know what it should do with
itself.

I believe it is standard behavior for a detail query to receive notification
of when its master changes state.

HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "Roger Webb" <RWebb@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, November 19, 2001 3:02 PM
Subject: Re: [IBO] Dataset States and Master Detail


--- In IBObjects@y..., Svein Erling Tysvær
<svein.erling.tysvaer@k...> wrote:
> Hi Roger!
>
> I think I would have attached your code to
BeforeInsert/BeforeUpdate and
> AfterPost of your TIB_Queries rather than the TIB_DataSources, but
I guess
> you may be able to work around your problems by checking the state
of
> ADataset.MasterDataset in addition to ADataset.
>
> HTH,
> Set

Well, I'm not doing anything in the Before Insert or the Before
Update, because thats not the effect I'm going for..

When the state of the Dataset changes... I want to change a label.
Which works in a single dataset environment. It also works in a
Master Detail...when you start editing the detail. It does not work
when you edit the master record... From what I can tell, it is
changing the label , but then the statechecking procedure is run by
the detail (which technically hasnt changed states. This returns it
to looking like it is in dssBrowse. Even though the MASTER is
dssEdit.

So I guess the problem is that when the Master query changes
states... the Detail query is firing off the OnStateChanged procedure
as well, even though it didnt change states itself.

- Roger