FileMaker Extra: Selection Portal

Books.fp7.zip9.88 KB

Back by popular request is an example of selection portals. This topic was covered in Special Edition Using FileMaker 9 but it had to be cut out to make room for the new FileMaker Pro 10 features. Now here's an example database that illustrates the technique.

It uses a cross-product relationship to produce a portal containing all possible values for a field. In this case, we're looking at a database of book titles, and the portal contains categories (such as Adult Fiction, Juvenile Non-Fiction, etc.). The categories can apply to any book, and you can build them by just adding data to the Categories table. When you click the Add Category button in the Books table, you see a portal with all the categories: just click Select next to the one you want to add to the book, and it will be added. Back on the Book layout, you can see as many categories for that book as you have selected, and you can delete any categories you don't want. This techniques is a good alternative to a value list based on field values. Thanks to Matt for asking for the code! By the way, this is not exactly the code that's in Special Edition Using FileMaker 9. It has some enhancements, but it is still FileMaker 9-compatible (it doesn't use FileMaker Pro 10-only features).