AnsweredAssumed Answered

Portal inside portal

Question asked by RedzwanLatif on Sep 2, 2012
Latest reply on Sep 3, 2012 by RedzwanLatif

Title

Portal inside portal

Post

Hi. I've followed the steps from this post. http://forums.filemaker.com/posts/b799cbbd79

Let's assume you have these three tables and relationships:

Master, Child, ChildDetail.

Master::MasterID = Child::MasterID
Child::ChildID = ChildDetail::ChildID

On a Master based layout, add portals to Child and ChildDetail. Define this Portal Filter for ChildDetail:

$$ChildID = ChildDetail::ChildID

Write this script:

Set variable [$$ChildID ; Value: Child::ChildID ]
Refresh Window [Flush cached join results]

Attach this script to either a button located in the Child Portal row or you can select all the portal row fields and use Button setup to turn the entire row into a button that performs the above script. (The second option allows you to just click a portal row to select the detail records in ChildDetail, but you can no longer edit the fields by clicking into them so use the option that works best for your layout needs here.)

Now one last detail. You can set a conditional format on all the fields inthe Child portal row with an expression like this:

$$ChildID = Child::childID

And specify a a light pastel fill color to "highlight" the currently selected portal row in the Child Portal to make it easier to see to which Child records, the currently visible ChildDetail records belong. (You can also specify a bold text style and/or a different text color.)

 

I've set the script trigger OnObjectEnter. But after I choose the portal row, whenever I enter the data in the ChildDetail portal, it would enter the data for portal row one. Are there any solutions or alternative ways for this?

 

Thank you :)

Outcomes