This topic is locked

Master Detail search part of the fild

6/30/2009 4:13:58 AM
PHPRunner General questions
K
kdgsv author

Hi,
I´ve got a question about master/detail relationship.
As i understand this right 2 fields are linked together and on the detail page all fields are shown which matched with the master field.
What I want to have is a kind of "search in the detail field"
I´ve 2 tabels, units and parts.
Both tables have a field called "modell", this fields are linked by master detail.

Master is units, detail is parts.
The modell field at the master table has allways only one value eg. 2000

The modell field at the detail table could have 2000, 4000, 6000, means more then one modell.
That means parts could be inside in more than one modell.
The details are only shown if the two modell fields are exactly the same.
how do I compare master filed with detail field so details are also shown when ther is more than on value in detail field.
Thx

K
kdgsv author 7/1/2009

Has no one any idea?

J
Jane 7/1/2009

Hi,
I see what you're saying.

Unfortunately there is no easy way to create this type of relationships in PHPRunner automatically.
As workaround you can set up modell field in the master table as custom on the"View as" settings dialog on the Visual Editor tab, create link with search parameters and pass modell value to the detail table.

K
kdgsv author 7/2/2009

Thanks Jane,
Could you please help me a littel bit with coding, please?

That would be great.
Table Units: Master
ID Name ModelType

1 Unit 1 2000

2 Unit 2 3000

3 Unit 3 4000
Tabel Parts: Detail
ID PartNr ModelType

1 12345 2000, 3000

2 11234 2000, 4000

3 11123 3000, 4000
linked together by ModelType.
When I klick on "detail" for unit2 then partNr 12345 and 11123 need to be selected.
thank you in anticipation.
Matthias

K
kdgsv author 7/2/2009

...I´m using PHPRunner 5.0.

J
Jane 7/2/2009

Hi,
set up ModelType field in the Units table as custom on the "View as" settings dialog on the Visual Editor tab.

Here is a sample:

$value = "<a href=\"Parts_list.php?a=search&value=1&SearchFor=".$value."&SearchOption=Contains&SearchField=ModelType\">".$value."</a>";

K
kdgsv author 7/2/2009

Thx Jane.
Only one more question <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=42418&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />
Let´s say, I want to select by more then one field.
There is a field called product range. In this field is always one value.
If I want to find all ModelType 2000 parts where productrange is orbital shaker.
Thanks
Matthias

J
Jane 7/3/2009

Matthias,
create URL with advanced search parameters for this purpose.

Here is a sample of how to get the URL of advanced search results page:

http://www.asprunner.com/forums/index.php?showtopic=5704