Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Trouble Getting Layout Number

Featured Replies

Hi,

 

I change my layout number to a name as soon as the layout is created.  And I've been stuck navigation to my layouts via the name not the number and here is why.  Any help here i would be grateful.

 

Thinking I could just use the "Get ( LayoutNumber )" function.  But to my surprise, nope!  I get the layout number based on the layout order in the layout pull done menu, hmm...

 

1 Home

2 Navigation

3 Preferences

4 Portal

5 ... ect.

 

So if I'm on my Portal layout, "Get ( LayoutNumber )" gets ... 4 Not ... 23

 

Which is what I'm looking for 23.  

 

Yet LayoutID ( FileName ) produces a list of all my layouts by ID.

 

So where is the Get ( LayoutID ) ???  I need this number to navigate to the layout I want.

 

Any suggestions 

 

Thank you.

 

Tom :-)

 

 

Why are you using either of these functions?

 

The standard FileMaker go to layout command handles layout renaming and layout re-ordering reliably and automatically.

  • Author

Hi Bruce,

 

My understanding I read somewhere that ... Best Practice is to use the Layout_ID not the Layout Name due to Layout Name changes especially if you have to write into your calculation the layout name and I'm forced to do this a lot ( if you have a better way please advise ) ...

 

If ( Get ( LayoutName ) = "ABC" ; Do This ; If ( Get ( LayoutName ) = "DEF" ; Do This ; If ( Get ( LayoutName ) = "GHI" ; Do This ; "" ) ) )

 

Get ( LayoutNumber ) is just a bad due to layout reorder :-(

 

Anyway, any guidance here I would be grateful.

 

Thank you Bruce.

 

Tom :-)

IMHO, the best practice is not to get into a situation where your calculation depends on the layout name (or ID). If this is truly unavoidable, you will need to find the index number of the current layout's name in LayoutNames() and use it to retrieve the corresponding value in LayoutIDs() - see:

http://www.briandunning.com/cf/908

 

Note that Filemaker allows you to have more than one layout with the same name - and if you do, there will be no way to tell them apart by name alone.

 

Another thing to note is that layout IDs are file-dependent. If you migrate your solution to a newer file, the layouts can easily be assigned different IDs and all your calculations with hard-coded IDs will need to be rewritten.  Just one more reason not to go that way.

Bruce didn't say to use the layout name. I think he assumed you were trying to navigate to a layout in a script.

 

Personally, for situations like I think you're describing, I use a text box on a layout with a name and a value. The calculation would reference this text box's name using the GetLayoutObjectAttribute() to get the value.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.