FMP Version: FileMaker 7 and Higher
Returns A Text Result
Layouts are linked to a defined table occurrence in the relationship graph. Please note that I said a table occurrence and not a table, although by default the occurrence is linked to a source table.
The Get(LayoutTableName) function will return the name of the table occurrence that is linked to the currently viewed layout in the foreground window. In many cases, the name of the table occurrence is the same as the table but not always. In particular, a complex FileMaker database may have many table occurrences linked to the same source table. In a case like this, you may need to have a standard way of naming your table occurrences. Using the same method each time, you might be able to use other functions to extract the base table information from the name of the table occurrence.
For example, if you always name your tables with one word and you always name your table occurrences with the base table name as the first word, then you could use the leftwords function to calculation the base table name of any currently viewed layout.
UPDATE: I wrote the majority of the above content when FileMaker 7 first came out. About a year later, a technique called the Anchor / Buoy (also called the Squid method) became popular. It became extremely popular with me and it is mainly due to how well it handles the ability to track what source table a layout will be linked to.
The source that turned me on to anchor buoy was a presentation by Kevin Frank and Associates. Here is a link, if you want to check it out.
More info about the author and FileMaker in general, contact me at firstname.lastname@example.org.
© 2007 - Dwayne Wright - dwaynewright.com
The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.