Home Datapipelines

Master/Detail Pipeline problem

edited February 2008 in Datapipelines
Hi,

I created two DBPipelines Master and detail. within detail DBPipeline I try
AddLink and the following tips that is create masterFieldLink.

The first master record always show all the detail records, and the
following master showing fine. I spend almost two days try to figure out
this simple things.

I am using the lastest RB with RAD 2007

Please help what I did wrong.

JF


---------------------------------------------------------
Tech Tip: Define Master/Detail DataPipeline Links in Code
---------------------------------------------------------

Defining a Master/Detail relationship for a DataPipeline
requires that the detail pipeline have the
following properties defined:

1. MasterDataPipeline

2. MasterFieldLinks


At Delphi design-time you can use the object inspector
and the DataPipeline's FieldLinks editor to define
the master/detail relationship.


The following example illustrates how to define the
master/detail relationship dynamically at run-time.


var
lFieldLink: TppMasterFieldLink;


begin

{define the master/detail pipeline relationship}
plDetail.MasterDataPipeline := plMaster;

{create a new field link }
lFieldLink := TppMasterFieldLink.Create(nil);

lFieldLink.Parent := plDetail;

{assign the detail field name}
lFieldLink.DetailFieldName := 'CustNo';

{assign the master field name}
lFieldLink.MasterFieldName := 'CustNo';


end;

Comments

  • edited February 2008
    Hi JF,

    In my quick testing with the DBDEMOS database and using the exact code
    provided with the article you posted, I was able to successfully link two
    datapipelines in a master-detail relationship in code.

    Where are you executing this code? Be sure your detail dataset is ordered
    on the linking field.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2008
    Hi, Nick

    I found problem. It is because DevExpress grid share the same datasource
    with datapipeline.

    It is hard to figure out since the only first master record have the
    problem.

    Thanks

    JF

This discussion has been closed.