Skip 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.

Layout Database

Featured Replies

I am trying to dynamically go to a layout depending on the value of a global field, but I am limited to jumping only to a layout number, rather than a name.

I have a clumsy solution, which involves generating keys in a layouts database, but was wondering if anyone had anything more elegant. Part of this is a simple script that loops through the layouts using Status(LayoutCount) Status(LayoutNumber) and Status(LayoutName).

I think what I'd really like is to be able to set several Global repeating fields, use the script to do a sort of PutRepetition of the LayoutName in one field, and LayoutNumber in another; then whenever I need the layout number, I can just loop through the repetitions until I find what I want, set a global field to that number, then do the goto.

Make sense, or am I beating around a very large shrubby thing?

I've done it the same way, by looping through the layouts by number and testing the layout name. You'll find you can't loop through repetitions as the Get Repetition() function won't take a variable for repetition number. You can use the approach, but no loop, you must test each repeat explicitly. The advantage to testing layout names is that if someone changes the order, it won't mess up the operation (but a layout name change will). -bd

Hi Tim

If you have "hundreds" of layouts, looping through will become slow. You could create a extra file with two fields: lay_name and lay_ID. In your main db, create a variable text field, say temp_lay_name. Make a relation with temp_lay_name to lay_name.

Now, you can set the temp_lay_name to the name of the layout you are needing, then you can jump to the layout number you will get on the related field lay_ID.

Sure, you have to create records of every layout you have, but there, you can use the looping with status(layoutname), as you have only to do this, when you are changing a layoutname or layout order..

Gerd

  • Author

Brent, Gerd

Thanks for your replies. Seems like one does it one way and the other another.

It'd be a nice-to-have in FM6 (Goto Layout (layout name from field xxx)

Now I could be totally misunderstanding what you want to do, but here's a suggestion:

Rename your layouts adding a number to their name e.g. layouts called Sales, Managers, Customers, become Sales LO1, Managers LO2, Customers LO3. Then use a script something like this:

If(TextToNum (Status(CurrentLayoutName))= 1)

Go to Layout (Sales 01)

End If

If you have lots of layouts, you'll of course end up with lots of of "Ifs", but I find this kind of script performs more quickly than a loop structure. Also, as long as you keep a number in there, you can change the layout name or its postion in the layout order without any problems.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.