There is a rather obscure but very useful feature available in one of the FileMaker design functions. The function FieldNames ( fileName ; layoutName ) ostensibly returns a list of the fields on the requested layout in the specified file. Nothing surprising there, but what if the layout you specify does not exist in the file? Aha! That’s when some interesting behavior kicks-in.
If, instead of passing the function FieldNames a layout name for the second parameter, you pass it the name of a table occurrence, FileMaker will return the full list of fields for said table occurrence. Fantastic! Of course, to make use of this behavior, you cannot have a layout with the same name as the table occurrence. So here’s one of my FileMaker development best practices…never, ever, EVER name a layout with the same name as a table occurrence.
Strangely enough, when you make a new table FileMaker creates a layout with the same name as the table occurrence. Do yourself a favor: chuck the layout, or at least rename it, and add a neat new function to your developer toolkit.
In a future posting to be titled “Generating Field Objects via Script and XML”, I’ll explain how you can leverage the FieldNames function to manage development layouts. It will include a great demonstration file that you won’t want to miss.
Dawn Heady is a Technical Project Lead for Soliant Consulting. During her 20 years as a FileMaker Developer she has been a business owner, a CIO in the credit restoration industry and the Vice President of a company specializing in FileMaker plug-ins. Dawn is a FileMaker 11 Authorized Trainer, a regular DevCon speaker, and a FileMaker 7 Idol finalist for her solution “Interface-RAD”.
Related posts:
- Applying Conditional Formatting to Multiple Objects Conditional Formatting is a FileMaker layout-level feature that allows...
- Auto-Resizing Layout Objects Movie: Auto-resize in action One of the significant new...
- Tables, table occurrences, and relationships Understanding the difference between a table and a table...
- Creating Dynamic Summary Charts The new Chart Tool of FileMaker Pro 11 is...
- Shifting Columns in Cross Tab Reports One of the 2009 Devcon presentations that I enjoyed the...
Related posts brought to you by Yet Another Related Posts Plugin.










Posted by Dawn Heady on July 22, 2009 at 11:50 am
