1 of 1 people found this helpful
There's a design function: LayoutNames ( FileNameInQuotes ) that you can use to get a list of all your layout names, but this has to be put into a stored, indexed field in order for your value list to work.
If you use an indexed calculation field with this function, it won't update automatically when you add, remove or rename layouts.
I'd define a text field to hold this list of values and use a script that runs when the file is opened:
SetField[YourTable::LayoutNameList ; LayoutNames ( get ( FileName ) ) ]
Now you can use a value list with the use values from field option to list the contents of the LayoutNameList field.
"can i have a layout menu on the top left hand corner in one of my layouts"
That can certainly be done. It's already done for you in the Status area, but I assume you want to hide the status area and thus need to add this menu directly to your layout.
If you define a global text field for your menu, you can format it with your value list and copy and paste it to any other layout in your file. If you are using FileMaker 10 or newer, you can use a script trigger on the menu to perform this script:
Go to Layout [YourTable::gSelectedLayout] // use the layout name by calculation option.
Where gSelectedLayout is the name of your global field.
Note that many developers create layouts that they don't want users to see as they serve behind the scenes purposes. If you have such, you'll need to modify this method to eliminate all layouts that you don't want the user to be able to choose from the menu.
Wow, Phil, you are a lifesaver!
Could you please show me how you could get the list to include only those layouts that contain the word "Forms"?
Thanks very much
This is an old post, but I'll assume you are using the calc to get the names of the Layouts with the
This is all the Layouts as you may have found.
Within that list (which is text), you can "find" a match which "contains" the text string "Forms" using text functions.
PatternCount would tell you HOW MANY, for example
From there I might loop each item (it's a return delimited list) with the GetValue() function
GetValue(myList; x) // the 'x' would be a number in an incremented serial each time through the loop
and test for the PatternCount. If it's > 0 then that particular item would be a "match".
thanks so much !! problem nicely solved