Brian Dunning's FileMaker Custom Functions

GetLayoutID ( layout )

Gets the layout ID of current or named layout

  Average rating: 4.1 (34 votes) Log in to vote

Ulf Carlsson   Ulf Carlsson - Show more from this author
Studentlitteratur AB

Share on Facebook Share on Twitter

  Sample input:
GetLayoutID ( "current" )
  Sample output:

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Use: Gets the Layout-ID of current layout if parameter layout="current" or of the layout which name is in parameter layout

Problem: You use some kind of navigation that want to switch to another layout when a button is pressed, but you want to be able to change both layout names and layout order without the solution breaks.

Solution: Use the function GetLayoutID in combination with the function GetLayoutNumberFromID to be able to do navigation between layouts without your application breaks if layouts change names or order.
In other words: Where you save which layout name or layout number to go to, save the layout id instead and then look up which number the layout has at the moment with function GetLayoutNumberFromID ( layoutID ).



Robert   Robert, Luxembourg Europe
Sep 30, 2010

Thanks for your function, but it is a little buggy.


LayoutNames="Complaints Test¶Blabla¶Complaint"

Function will return the ID of the 1st value but should return the ID of the 3'd value.

replace: theLayoutNames = LayoutNames ( Get ( FileName ) );
with:theLayoutNames = "¶" & LayoutNames ( Get ( FileName ) ) & "¶";

replace:theLayout = If ( layout ="current" ; Get ( LayoutName ) ; layout );
with=theLayout = "¶" & If ( layout ="current" ; Get ( LayoutName ) ; layout ) & "¶";

replace:Position ( theLayoutNames ; theLayout ; 1 ; 1 ) ) ;
"¶" ) + 1 ;
with:Position ( theLayoutNames ; theLayout ; 1 ; 1 ) ) ;
"¶" ) ;

Roman Hofstetter   Roman Hofstetter, Zurich
Aug 30, 2011
This function doesn't work, if you have a Layout named "Example1 Overview" and a Layout named "Example1". If you search for "Example1", the script step Position() will now the position of "Example1 Overview" and you get the wrong ID.
Solution: Check if the Layoutname is on the beginning or the end. Otherways search for ¶Layoutname¶. Like that you're sure the whole name is identical.

Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 16 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: