1 Reply Latest reply on Mar 24, 2015 2:52 PM by disabled_ntaylor

    getRelatedSets() Returns One Result for Multiple Portals

    millennium

      Summary

      getRelatedSets() Returns One Result for Multiple Portals

      Product

      FileMaker Server

      Version

      13

      Operating system version

      OSX Yosemite

      Description of the issue

      When calling getRelatedSets() for a layout through the FileMaker PHP API, a single result is returned if there are multiple portals based upon the same table on the given layout.  This is true even if the portal objects are given different names in Inspector.

      This prevents getting different arrays for portals with different filtered results from the same related table.

      Steps to reproduce the problem

      Create a table of Parents and a table of related Children.
      Create a layout based on Parents
      Add a portal of Children named "Sons" with a filter of "boys"
      Add a second portal of Children named "Daughters" with a filter of "girls"

      Use the following PHP code to return the list of portals:
           $relatedSetsNames = $result->getRelatedSets();     
           echo "

      Here are the portals:

      ";
           foreach ($relatedSetsNames as $relatedPortal)
           {
                echo '' . $relatedPortal . '

      ';
           }

      Note that only one portal is listed and the resulting getRelatedSet('Children') array contains only the boys.

      Expected result

      Two related sets, "Sons" and "Daughters" should be available.

      Actual result

      Only the "Sons" portal is available as table "Children"

      Workaround

      We could create separate layouts with each portal and build the arrays for display.

      We could also create multiple table occurrences for every filtered portal.

      But shouldn't the portal object names be available for calling with getRelatedSet()?