Thank you for the post.
Please review “Filtering portal rows returned by find requests” on page 40 of the FileMaker® Server 13 Custom Web Publishing with PHP guide.
Specifically, the “The setRelatedSetsFilters() method takes two arguments:” part is particularly relevant.
The syntax does not reference a portal but a table or a layout. The names of the portals do not matter. If referencing a layout, then only one portal can be queried. So, either each portal will need to be based on its own table occurrence or if referencing the layout, then all records in a single portal can be found.
I agree with the statement in the guide which says, "In a solution that has many related records, querying and sorting portal records can be time consuming." Unfortunately, it seems that the limitation of being able to only reference one portal and not being able to take advantage of the speed of different filters on multiple portals of the same table is unfortunate. I think based on this, the matter belongs in the category of bug or poor design.
Thank you for the reference as it would be helpful if I wanted to use a filter in some cases and not in others. In this case, I need to use three filters on three portals.
For others facing this same problem, the solution does seem to be to create multiple table occurrences, one for each portal/filter needed.
We've resolved to create relationships for each portal based upon the same table for any given layout, but can you confirm what is stated here: http://www.formulationspro.com/pages/filemaker/php_detail.php?id=116 specifically that setRelatedSetsFilters() does not actually use the portal filters defined for the portal when referred in a PHP query?
The poster states, "What that means is that the 'layout' option is ignored. The only thing this feature does is limit the number of related records returned to the browser. It does NOT use the Portal Setup dialog box settings to filter the records. FileMaker will be updating the documentation in a future release to correctly document the features of this method."
This would mean that for each filter, we must create a different table occurrence and relationship, not only a different table occurrence and relationship for each portal? Has this been documented anywhere? It sounds like the first argument is useless for setRelatedSetsFilters(). Can you help us understand how it might be used in an example?
Thank you for the reply.
Please review the forum thread where this was reported:
Your current understanding is correct. Additionally, I have added your comments to the original report made to Testing and Development and alerted the Documentation department.