Another great new feature in FileMaker 11 is the ability to filter portals without needing to create specific relationships, as was with previous versions. There are a couple of drawbacks to this – although if your requirements are fairly basic you’re unlikely to find either a major problem.
The first drawback is that the filtering is at the user-interface level only, and does not affect the actual relationship between the two table occurrences. The net effect of this is that the filter you apply to the portal won’t alter the result displayed in summary fields of summary calculations in the related table, that are outside of the portal. If, taking the Invoices starter solution as an example, you wanted to filter the invoice line items portal based on the product name (perhaps the first word of a product name, with a large number of line items this may be useful), the price calculation fields would still reflect the cost of ALL the line items, not just those that were displayed in the portal. In that particular example, that’s not a bad thing, however if you were to take a slightly different portal filtering requirement, such as a portal showing related tasks for a project with due dates and time estimates, and you had a summary calculation Sum ( Project_TASK::estimateTime ), basing your filter on the “status” field of the task, wouldn’t affect the result of that SUM calculation. See the attached file to see what I mean.
There is a workaround to this, and it’s a fairly elegant workaround – so no “hacking” required! Just create another single row filtered portal, using exactly the same filter as your main portal, and place the summary calculation field within it. The calculation will update when the filter changes.
The second drawback is the way the Goto Related Record (GTRR) script step works, specifically when it’s defined to “Show Only Related Records” – with the native portal filtering, the GTRR will show all the records that would be displayed in the portal if there filter wasn’t in place. This is because the portal filter doesn’t change the relationship between the table occurrences. Again, this is less of an issue in some applications than others.
Native portal filtering is a really useful feature for beginner and intermediate level FileMaker developers. It gives you a quick and easy way to filter your portals (and of course you can make the filter based on whatever criteria you like), that doesn’t require you to create additional relationships.