1 Reply Latest reply on May 15, 2013 3:44 PM by philmodjunk

    Tabs, Portals and Filtering

    RyanJordan

      Title

      Tabs, Portals and Filtering

      Post

           Hello:
           New user here so if I miss any pertinent information, please let me know.

           Using FMP12, PC version.

           I have a Layout with several tabs. The over-arching idea is to click on a tab and have the portal view come up already filtering the connects labeled on the tab.  I have set up a global field and linked it back to its parent. The global field currently is used to populate multiple records. Example: for each building, I may have multiple rooms. Each room is a separate record, but each room has four walls, a floor and a ceiling. Those fields are listed within the global field.

           So ideas I have had have been filtering the portal using a variety of terms (I can't find one yet that helps). Using a script that links the tab to selecting the global field and thus displaying the portal correctly. (This seems to be a work around and I am not sure a script can do that?). or perhaps not using a global field? The only issue is that I need a way to have multiple records be populated using terms from the global field, ie. floors would be the first field to be filled out, then room name.

           I have included a screen capture to provide some more detailed information on the relationships.

      Capture.JPG

        • 1. Re: Tabs, Portals and Filtering
          philmodjunk

               It seems unecessary to include the school name in the relationship. Just linking by School_ID should be sufficient for matching up records by school.

               If you are going to use filtered portals on each tab, you don't need to use the global field, though that is an option. You can set up different filter expressions on each portal on each tab that filter for the sepecific item (floor, ceiling...) without any need to reference the global field.

               You might, for example, set up this filter expression for the Floors tab:

               Assembly Condition assessment_Type::Assembly_Type = "Floor"

               But I am guessing as to what exact value to put in quotes. The same type of filter expression can be used on each tab, you just change the text in quotes in each filter expression.

               But this only controls what data is DISPLAYED in the portal. If you are using these portals for data entry, you can enter data for any assembly type on any tab, but if it's the wrong tab, the record will disappear from the portal where you entered the new data and will then appear in the portal of the tabe where the filter permits display of that record.

               You may want to put a script trigger on the tab control that updates a global variable with the type specified for whichever panel of the tab control is currently in front. You can then refer to this global variable in an auto-enter calculation to automatically set the correct assembly type of any new record added into the portal on that specific tab panel.

               The exact script to use to set the global variable's value depends on the version of FileMaker that you are using.