FileMaker Extra: Publishing Related Data

FileMaker Mobile 8 does not support FileMaker Pros relational data model in the publication of databases to handheld devices. As has been discussed before, it will publish only a single table from any given database file and can publish no more than 50 fields from that single table. This, although a hindrance, should not lead you to believe that FileMaker Mobile 8 cannot be used to manage related data; it just requires a little ingenuity and the willingness to think creatively about data presentation and management.

Lets begin with a simple and very common relational structure: a table of parent records (companies for this exercise) and a table of related children (employees). Designate a field, _kp_CompanyID in the Company table and _kf_CompanyID in the Employee table, to define the relationship. As it is, this simple database would not be publishable through FileMaker Mobile.

On a trivial level, you could consider putting the Companies and Employees databases in different physical files; this would, nominally, allow both tables to be published to your handheld simultaneously, but it would not link them to each other and would therefore not be very useful.

The other possible solutions require that you consider how the data is likely to be used in a mobile environment. Although Company is clearly the parent data structure, everyday practice may indicate that more often the focus for users is the Employee table. In this case, you might be more likely to need to contact a person at a company than the company itself. Lets say that this is true enough in this test case; you then would need a solution to the problem of displaying a list of employees with related information from the Company tablesay, for example, the name of their company. It is worth noting that when looked at from this perspective, the data contains only one-to-one correspondences between the data elements in the two tables. (There will be only a single company for any given person/employee.)

At this point, given these assumptions, the solution is close at hand. You need merely to find a way to get the company data from the Company table, through the relationship and into a field in the Employee table, without using calculation fields (remember that calculation fields are not supported in FileMaker Mobile 8). A text field must serve as the repository for this information within the Employee table. You will need to write a script that will copy data from the Company table to the Employee table before synchronization (or you can set an auto-enter by calculation formula to pull data from the Company table and retrigger this calculation via a script). The script you might write would likely loop through your found set and push data into the Employee table (using the Set Field script step).

Категории