Do you have one relationship or two linking Quotes to Building?
I can read your post as a "multi-predicate" relationship--a relationship with more than one pair of match fields, or as two different relationships, each with their own pair of match fields.
Which do you have.
I'd use a multiple row portal to building with just this relationship:
Quotes::ID = Building::Quote ID
Then I'd add a second relationship:
Quotes::CurrentBuilding = LineItems::BuildingID AND
Quouts::ID = Lineitems::Quote ID
and use that for my second portal.
A button in the portal row of the first portal or a script trigger on it can perform this script:
Set Field [ Quotes::CurrentBuilding ; Building::Building ID ]
That way, I can view/edit/create/delete line items for a current building record in the lineitems portal by clicking a row in the building portal. A conditional format can be used to highlight the currently selected row in the building portal to help the user keep track of which building record is currently selected.
Note: I used a second pair of match fields in the second relationship so that you can list the same building on multiple quoates and still only see the line items for a given building specific to the current quote.
I have a multi-predicate relationship. I don't have enough room for a multi-row portal to building as there are too many fields to be displayed in the building dB (the layout is seriously packed, but I don't know how to get around it--data entry is not linear).
If I do stick with a one-line portal for building, any suggestions of how to get CurrentBuilding to reset to 1 every time a user opens the quote?
Which is true about your building table?
1) You have one and only one record for each building.
2) You have multiple records for the same building, each linked to a specfic quote record.
Your relationship implies 2) but the rest of your layout design suggests 1).
It doesn't look like you need a portal to Building at all here.
You can just have a portal to LineItems and, if you want, you can set it up with a value list field and a portal with a filter expression that uses that field such that you select a building in the global field and the portal lists just lineitems for that building.
Hey, you are right, I don't need a portal to Building. Thanks.