Brian Dunning's FileMaker Custom Functions

xPFilter

To give portal filtering on up to four words - in any order and to exclude records containing search words commencing - and to inc those commencing + and the OR search

  Be the first to rate this function Log in to vote

Nick Lightbody   Nick Lightbody - Show more from this author
Deskspace Systems Limited
http://deskspace.com

Share on Facebook Share on Twitter

  Sample input:
xPFilter ( ; )
  Sample output:
[a binary flag - ie yes / no for each record to control which records are displayed in the portal]

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

To filter records for up to four words in any order or position within a record field

(NB: the spacing for this content is correct when viewed in an monospaced type face in a text editor)

xPFilter (Fn2search;Fnsearch)

The master function calls the appropriate sub function depending on how many words are input - hence there are 4 sub functions below - just to avoid doing more processing than necessary. This is called in the portal filter.
Although it is much slower than a scripted find it enables users to find records they otherwise miss with a normal string search - it is very popular with users.
I published a 3 word version on the FM Community site.

The input is the fieldname to search and name of the global field used for search in the Ui. The fieldname to search in this system is the autoentered summary field containing all the data on which we want to search.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: