Selectors In SeedCode Complete

Selectors (aka pickers) are one of the common design patterns in SeedCode Complete. Linking records from one to the other is an important part of any database and Complete relies on Selectors to accomplish this.

When you want to link a Contact to an invoice, you will be brought to the Contact Selector where you can quickly look up existing Contacts by typing there name in the Keyword field. By default, this search is done using TypeAheads locally or on the LAN, but not on WebDirect or the WAN.

If the desired Contact is not found, then a New Contact may be created from the Selector using the New Contact pop-over button.

Behind The Scenes

The Selector works by doing a FileMaker find in the Control File and returns the IDs of the records found as a script result back to the SeedCodeComplete file. The Control File is hidden in the background using the MVC architecture so does not cause any flashing or disturbance to the SeedCode Complete file.

Once the IDs are returned they are loaded into a Global Variable where they are in turn read by calculation fields in the Rows Table.

These calculation fields are then linked to Table Occurrences of the appropriate table so fields from these tables can be placed in the Selector Portal.

This makes it very easy to change which fields show on the Selectors.

Control File Selector Scripts

These scripts are actually pretty simple and basically consist of going to a layout in the Control File and doing a find, sorting the results and then returning the list of IDs using the ListOf Summary field. That's why all tables in the Model file have the ListOfIds summary field in them.

Since these script use standard FileMaker, they're relatively easy to modify, so you can extend the keyword to other fields, for example.

[email protected]
Follow us: