8 Replies Latest reply on May 7, 2012 10:21 AM by philmodjunk

    Filter through portal or filter through relationship?

    DRR

      Title

      Filter through portal or filter through relationship?

      Post

      I received assistance previously in setting up a portal on a layout using the same table through duplicating a table occurance. The portal is divided into alphabetical groupings with a calculation and is able to pull up a list of my patient's via their last names. However, I have an "Active/Inactive" radio set field and I would like to filter the portal to only pull in and display "active" patients. I have tried different calculations, but none seem to work. I will enclose a series of screen shots to clarify the situation. 

      Thanks

      Page_1.gif

        • 3. Re: Filter through portal or filter through relationship?
          GuyStevens

          The way to think of this is that you need a field in the relationship that is the same.

          In other words. Your patients in the portal can only be seen if they are "Active"

          So you need to create a relationship between the "Active" field on the one side of the relationship.

          On the other side of the relationship you need to have a field that determines wether if "Active" or "Inactive" records are shown.

          One way to do this is create a field with global storage that's set to the value "Active".

          An other way to do this is to create a text field with an auto enter of "Active" in your Patient Chart table. (Be sure to set the value for all the existing records. You don't have this problem with a global field)

          Then you create this relationship between your table and the second table occurrence of your table.

          PatientChart::Active-------=-------PatientChartTableOccurrenceForPortal::GlobalActive

          Yo will want to change your cartesian join (X) in the above relationship.

          In your portal you will see all the records where the "Active value" is equal to the value in your global field.

          In that way you could even make a "switcher" that would change the value in your global field and gives you the ability to switch between "Active" and "Inactive" records.

          • 4. Re: Filter through portal or filter through relationship?
            philmodjunk

            Modify your portal filter to include a check for the "active" status in your radio button field. If the button enters "active" into the field for active patients, use this expression:

            Left ( The patient list::Last_name_field ; 1 ) < "E" ) AND The patient list::Status = "Active"

            • 5. Re: Filter through portal or filter through relationship?
              DRR

              I think I know what you mean (and I apologize for my slowness), but I don't have access to PatientChartTableOccureanceForPortal (or what I have as "The Patient List") since it is a second TO for Patient Chart. Therefore, how to I go in and change its Active_Inactive to just a checkbox and make it a global? Secondly, do I eliminate the current connection between the two through Patient Name and just do the connection through Active_Inactive?

              • 6. Re: Filter through portal or filter through relationship?
                philmodjunk

                DaSaint's solution works, but also requires either a change in your layout design or creating multiple additional occurrences for each tab in your tabs that list patient names. If you modify the portal filter expressions, you don't have to make those changes.

                • 7. Re: Filter through portal or filter through relationship?
                  DRR

                  Thanks. Solved. Though the actual filter looks like this:

                  Left ( The patient list::last_name_field_c ; 1 )   ≤  "E"Left  AND The patient list::Active_Inactive = "Active"

                   

                  For some reason, the "<</span>" part gives me an error, thinking a ")" should be in there between "span" and >

                  • 8. Re: Filter through portal or filter through relationship?
                    philmodjunk

                    You should have:

                    Left ( The patient list::last_name_field_c ; 1 )   ≤  "E"  AND The patient list::Active_Inactive = "Active"

                    What you posted had an extra "Left" that shouldn't be there...

                    What I typed is not something you can copy and paste into FilMaker as it uses underline formatting created by HTML tags to get the inequality to look right. Span is an HTML tag that will trigger errors in FileMaker as it has no way to process that syntax.