3 Replies Latest reply on Aug 29, 2011 8:18 AM by LaRetta_1

    Filtered portals still contain records, they are just "hidden".

    dhafitch

      Summary

      Filtered portals still contain records, they are just "hidden".

      Product

      FileMaker Pro

      Version

      11.0v4

      Operating system version

      Mac OS 10.6.8

      Description of the issue

      Thinking that portal filtering omits records from a found set, I set up a script to retrieve values from records in a filtered portal.  However, the script retrieved ALL the records, including those that were "filtered out" by the portal filter.  Thus portal filtering does not work to limit records for script steps.

      Steps to reproduce the problem

      Use portal filtering to "remove" records from a portal, such as Line Items. You can even filter out ALL records.  Then use the Go to Portal Row script steps in a script to retrieve records.  You will find that even the portal records that are supposed to be hidden are retrieved.

      Expected result

      One would have thought that, if you can't see the portal records in the portal, they should not be retrievable via the Go to Portal Row script steps!

      Exact text of any error message(s) that appear

      No error message.

      Workaround

      You have to design Find scripts to not only find records, but then omit those. Do NOT use portal filtering if you want to limit your selection of portal records in scripts.  This seems not to be well documented.  There should be warnings all over the place about filtering just being a means to "hide" records which, however, are really still there!

        • 1. Re: Filtered portals still contain records, they are just "hidden".
          LaRetta_1

          Hi David,

          I would like to replicate your issue but am having trouble doing so. 

          "You will find that even the portal records that are supposed to be hidden are retrieved."

          Portal filtering does not filter the relationship.  And scripts, unless you are in the portal, will see ALL related records.  If you have filtered a portal so there are no records then you cannot even go to the portal (unless 'allow creation' is turned on in the relationship) in which case you should be able to go to the first row to create a new record.

          " that portal filtering omits records from a found set,"

          Portal filtering doesn't affect the found set of the parent (the layout you are on).  Can you provide us with step-by-step to reproduce what you are trying to do?  You may have discovered a bug in the lastest updater but odds are, it is misunderstanding. :^)

          • 2. Re: Filtered portals still contain records, they are just "hidden".
            dhafitch

            Hi LaRetta,

            Many thanks for your reply!  After some experimentation, I found the problem, and also found documentation:

            "Go to Related Record
            This script step can potentially expose all the related records for the portal, not just the filtered records. This is somewhat unavoidable, akin to how a portal with sorting enabled would not go to the new layout with the records sorted the same way as the portal had been."

            Thus, I must have misunderstood how script steps work with filtered records in portals.

            Dave

            • 3. Re: Filtered portals still contain records, they are just "hidden".
              LaRetta_1

              If you go to a filtered portal row before you evoke the GTRR, it will go to only the filtered records.  ;-)