Jump to content

This topic is 4522 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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 ) ).
Posted

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

Posted (edited)

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
Posted (edited)

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

This topic is 4522 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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