In this case, the calculation might look something like this: tmProject_tmTask = “Open”. A simple example of how this can be useful is in a Task Management system where you want a portal in the project detail layout which shows only open task records. If true, the record will appear, if false, the record will not appear. The calculation entered will be evaluated as true or false for each related record that would normally appear in the portal. When selecting the check box to “Filter portal records” or clicking the “Specify…” button, we are presented with the standard calculation window. Step Three – Set the Portal Filter CalculationįileMaker introduced a new feature in FileMaker 11 which allows us to specify a calculation to filter the records that appear in a portal. If this evaluates to true, and there are still words left in needle ( WordCount ( needles ) < 2 evaluates to false), then we make the recursive call with the remaining words in needles, thus bringing us closer to our second base condition. The second defining condition exists when we find a match Left ( word Length ( needle ) ) = needle, which tells us that the first letters in the word we are searching are the same as the the search criteria.The second base condition is when both Left ( word Length ( needle ) ) = needle and WordCount ( needles ) WordCount ( haystack ).Which tells us that we have reached the last word in haystack, and did not find a match, so we return false. The first base condition is start > WordCount ( haystack ).It will loop through each word in haystack for each word in needles.
Our function, FindWordPartsInText, is somewhat complex in that it has double recursion. The defining condition must always lead to the base condition eventually in order to avoid infinite recursion.
To achieve the affect we are looking for, we will set a portal filter which will use a custom function that we will write that will find records that have words that begin with the search criteria typed by the user. Global fields can be accessed from any context whether or not a relationship exists between the tables. Tip: To keep your data tables clean and better organized, I recommend having a separate table to hold global fields that are not directly associated with a particular table.