5 Replies Latest reply on Jan 8, 2012 11:34 AM by Sorbsbuster

    Filtering a portal on Filemaker < 11

    valeriorrrr

      Title

      Filtering a portal on Filemaker < 11

      Post

      Hi, I read on the internet that is possible to filter the records from a portal with FileMaker Pro 11. Is there a way to accomplish it under a version < 11? A script associated to a button would be fine too, pressing the button will filter the portal.

        • 1. Re: Filtering a portal on Filemaker < 11
          Sorbsbuster

          You could make the relationship to the portal additionally have a global value, say, in it.  Then the button could change the global value to be the filter criterion you want.

          • 2. Re: Filtering a portal on Filemaker < 11
            valeriorrrr

            Sorbsuster I do not follow you, how could I display only some records then in the portal? Could you give some example please?

            • 3. Re: Filtering a portal on Filemaker < 11
              Sorbsbuster

              Suppose you have a two tables:

              - Customers
              - Invoices

              You create a relationship CustomerID -> CustomerID between those two tables.  The portal of invoices drawn on the customer record would list all invoices for that customer.

              Now:
              - create a calculation in Invoices:  InvoiceYear = Year (InvoiceDate )
              - create a global number field in the Customer table, and call it gYear.
              - change the relationship to have two criteria; the original one by CustomerID, and now gYear = InvoiceYear as well
              - as you select a different year it should filter the invoices listed to only show that year.

              That's just an example.  You may have to trigger a screen refresh to force the relationship to recalculate.

              • 4. Re: Filtering a portal on Filemaker < 11
                valeriorrrr

                It is more clear now, thanks, but why shall it be a global field?

                • 5. Re: Filtering a portal on Filemaker < 11
                  Sorbsbuster

                  Good point! -  and in many ways it makes no difference.  But it is a habit that I am in.  The reason would be that it lets different users have different values of the field, at the same time.  Also, when you change record it will still have the same value.  But you are right - that could be either a good thing, or a bad thing, depending on how you want the user experience to look.

                  Either will work the same way on any one record.  If you change record the filter will not be there, and it's up to you to say if that is a good thing or bad.