Board index » delphi » Master/Detail doesn't work since IBX 5.04

Master/Detail doesn't work since IBX 5.04

Hello All,

After minor modifications in an application with a master/detail
relationship using IBDataSet-Datasource-IBDataset I was having problems when
inserting a new detail field. Error message saying that the field
representing the connection between the two datasets must not be NULL.
After spending some hours searching throug my code and not finding anything
my last remedy was to downgrade from IBX 5.04 back to 5.03 which seems to
have solved the problem. Is this a known issue?

Florian

 

Re:Master/Detail doesn't work since IBX 5.04


Quote
Florian Hector wrote:

> Hello All,

> After minor modifications in an application with a master/detail
> relationship using IBDataSet-Datasource-IBDataset I was having problems when
> inserting a new detail field. Error message saying that the field
> representing the connection between the two datasets must not be NULL.
> After spending some hours searching throug my code and not finding anything
> my last remedy was to downgrade from IBX 5.04 back to 5.03 which seems to
> have solved the problem. Is this a known issue?

No it is not.  Are you certain you are not counting on the master field's value
to be copied to the detail field's value?  If so read the readme.

Quote

> Florian

--
Jeff Overcash (TeamB)  
  (Please do not email me directly unless asked.  Thank You)    
A spider wanders aimlessly within the warmth of a shadow, not the regal creature
of border caves, but the poor, misguided, directionless familiar of some obscure
Scottish poet.  The mist crawls from the c{*word*7}like some primordial phantom of
romance To curl, under the cascade of neon pollen.  While I sit tied to the
phone like some expectant father, your carnation will rot in a vase.  (Fish)

Re:Master/Detail doesn't work since IBX 5.04


Jeff, are you refering to this?

8.  Changed support to copy the master value down to the detail field
    on a new record.  The GeneratorField will fire first before
    the copy is made.  Also there is a new global variable,
    CopyMasterFieldToDetail, which MUST be true for this to work.
    It defaults to false.  The copy logic is simple, if
    the master field name matches the detail param name and also
    matches a detail field name it will be copied down.

If so, where do I set this global variable?

Florian

Re:Master/Detail doesn't work since IBX 5.04


On Thu, 24 Oct 2002 07:32:58 +0200, "Florian Hector" <FHec...@web.de>
wrote:

Quote
>Jeff, are you refering to this?

>8.  Changed support to copy the master value down to the detail field
>    on a new record.  The GeneratorField will fire first before
>    the copy is made.  Also there is a new global variable,
>    CopyMasterFieldToDetail, which MUST be true for this to work.
>    It defaults to false.  The copy logic is simple, if
>    the master field name matches the detail param name and also
>    matches a detail field name it will be copied down.

>If so, where do I set this global variable?

Since it is global you can set it anywhere you want. How about the
OnCreate event of your main data module.

Quote

>Florian

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Re:Master/Detail doesn't work since IBX 5.04


Quote
Florian Hector wrote:

> Jeff, are you refering to this?

> 8.  Changed support to copy the master value down to the detail field
>     on a new record.  The GeneratorField will fire first before
>     the copy is made.  Also there is a new global variable,
>     CopyMasterFieldToDetail, which MUST be true for this to work.
>     It defaults to false.  The copy logic is simple, if
>     the master field name matches the detail param name and also
>     matches a detail field name it will be copied down.

> If so, where do I set this global variable?

Anywhere.  Place it in the intializationof your main form.

Quote
> Florian

--
Jeff Overcash (TeamB)  
  (Please do not email me directly unless asked.  Thank You)    
A spider wanders aimlessly within the warmth of a shadow, not the regal creature
of border caves, but the poor, misguided, directionless familiar of some obscure
Scottish poet.  The mist crawls from the c{*word*7}like some primordial phantom of
romance To curl, under the cascade of neon pollen.  While I sit tied to the
phone like some expectant father, your carnation will rot in a vase.  (Fish)

Re:Master/Detail doesn't work since IBX 5.04


Quote

> Anywhere.  Place it in the intializationof your main form.

Didn't do me any good. The error is still the same.
I think I do have exactly what you describe in the readme:
Master is: AbtID Primary Key of the master
                AbtName String

Detail is: AbtID Foreign Key referring to the PK of the master
             SchlwID Primary Key of the Detail
             More Fields...

The select statement of the detail dataset is something like this:
Select AbtID, SchlwID, ...... from tabSchlw where AbtID = :AbtID
Between the DataSets I have a DataSource to which the detail is attached.

I put a datasensitive editbox showing AbtID of the detail onto the form to
see what happens when.
When I go back to IBX 5.03 and insert a new detail the value of AbtID
doesn't change from previously when it was only displayed. After installing
IBX 5.04, the value of AbtID dissappears and is never inserted by the
component, when posting I get the error

Any hints

Florian

Other Threads