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.

Get Layout Number per each Table

Featured Replies

Hi there,

does someone know is possible to count Layouts but per each Table separatly?

So if You got table: "Car" which has layouts: Price_List, Model and Purchase

And then table: "Contacts", with layouts: Contact_List and Contact_Profile

Obvious that table "Car" has three layouts and "Contacts" has two...but can we figure out that in script which will make calculation of how many layouts are per certain table?

Any help appreciated

Thanks in advance

Using the Go to Layout (First, Next) script step and Get ( LayoutTableName ) function, you could set up a script that loops through all layouts, checks what table occurrence each layout is based on, and increments separate counter variables for each TO. Note that this would count layouts by table occurrence, not by table. Using repeating variables with an encoded table name ("$TOLayoutCount[Code ( Get ( LayoutTableName ) )]") may be helpful for storing the counts if your TO names are no longer than 80 characters.

An alternate approach might be to:

  1. Build a return-delimited list of TO names on your scan through all layouts.
  2. Make a copy of that list with duplicates removed.
  3. For each TO name from the deduplicated list, count the number of layouts with ValueCount ( FilterValues ( $originalTOList ; $currentSearchTO ) ).

Automatic message

This topic has been moved from "FileMaker Product FamilyFileMaker Pro 12" to "Database Schema & Business LogicManaging Scripts".

The FileMaker Product Family >> FileMaker Pro 12 is intended for the discussion of the functions, features and tools that were new in FMP 12.

All how-to question should be posted to a topic area that best matches the sprit of the problem. Many questions can fit into more then one area, but you only need to pick one, and go with it.

If you have any questions about this action, please contact me through a private message.

Lee

Why would you need this? Just curious

Here is one way using script (see attached fp7 file). It produces list as:

Contacts: 3

Invoices: 2

... etc and then sets a global text field with the list. If you need it in a different format let me know.

UPDATE: file removed because it wasn't applicable.

Edited by LaRetta

I confess to being a bit lazy in this script. I should probably put the loop within the loop. But since variables make life so easy, and since the number of loops ( layouts ) would/should be fairly small, I went the simple-to-interpret way ( I hope ). And I didn't need to wrap the Go To Layout [ num by calc ] with GetAsNumber() either. Geez, and also be sure to Set Variable [ $$result ; "" ] at the end. My apology. :idot:

Edited by LaRetta

Oh! Right! DOH. Thanks Dan! Well it was fun anyway!! :^)

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.