Re: Different Categories [message #4945 is a reply to message #4941] |
Fri, 28 August 2015 05:25 |
AJM
Messages: 2371 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
A child database table which has more than one parent is a common occurrence. If you look at RADICORE's database structure you will see several examples where a table has more than one arrow going into it.
Your statement "The child record should be shown each time one of the parent records are chosen." leads me to believe that any one of the parents should only ever have a single entry in the child table. There is no pattern for this as it does not require its own screen structure or any different behaviour. All you need do is modify the _cm_pre_getDdata() method for each parent to include a JOIN to the child table, and the data for the child will automatically be included with the data for the parent. Note that if the child table has more than one qualifying row then the result set will contain multiple rows, one for each parent-child combination.
The normal way to deal with a parent-child relationship is to start with a LIST2 pattern which has separate areas for both the parent and child entities, and where the parent entity shows one row at a time while the child entity is allowed to have multiple rows.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|