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.

Keeping found set when changing to related file

Featured Replies

Hello All,

I have a relational database with a form and a find layout in file1 and a list form in file2. After performing a find using the find layout in file1, I want to switch to the list layout in file2 but only display the found records.

Can anyone help me on this one?

Greetings, Eric

quote:

Originally posted by erc:

Hello All,

I have a relational database with a form and a find layout in file1 and a list form in file2. After performing a find using the find layout in file1, I want to switch to the list layout in file2 but only display the found records.

Can anyone help me on this one?

Greetings, Eric

In the script that takes the user from the first database to the related database, include a script step:

Go to Related Records [ Show only related records]

Perform Script [ Sub-scripts, External: "file 2" (a script to take the user to the list layout) ]

This will do what you want.

Chuck

Depending upon the relationship, the Goto Related Records script step may not do what you want. Assume one record in File1 relates to multiple records in File2 by a File1 Record # and you have a found set of records in File1. The Goto Related Record (show only related records) script step will only show the related records in File2 for the record you are currently on, NOT for the entire found set.

To show all the related records in File2 for the found set in File1 (in this example related by File1 record#), create a global text field for the left side of the relationship, enter all the File1 records numbers from the found set into this field separated by carriage returns, and then perform the Goto Related Records (show only related records) script step. The global field can be filled with a looping script or by creating a list view with only the record number field (no labels, no graphics, etc.) and performing a copy all script step followed by a paste tothe global field.

-bd

[This message has been edited by LiveOak (edited September 14, 2000).]

quote:

Originally posted by LiveOak:

Depending upon the relationship, the Goto Related Records script step may not do what you want. Assume one record in File1 relates to multiple records in File2 by a File1 Record # and you have a found set of records in File1. The Goto Related Record (show only related records) script step will only show the related records in File2 for the record you are currently on, NOT for the entire found set.

To show all the related records in File2 for the found set in File1 (in this example related by File1 record#), create a global text field for the left side of the relationship, enter all the File1 records numbers from the found set into this field separated by carriage returns, and then perform the Goto Related Records (show only related records) script step. The global field can be filled with a looping script or by creating a list view with only the record number field (no labels, no graphics, etc.) and performing a copy all script step followed by a paste tothe global field.

-bd

[This message has been edited by LiveOak (edited September 14, 2000).]

Sorry about that. I misunderstood the question. The best way to find all records related to all records in the found set is just the above technique.

Chuck

  • Author

Can you give me an example of a script and how to set up the global field. In other words, I need more details because I'm new to Filemaker. Thanks...

Greetings, Eric

quote:

Originally posted by erc:

Can you give me an example of a script and how to set up the global field. In other words, I need more details because I'm new to Filemaker. Thanks...

Greetings, Eric

Go into Define Fields and type in the name of a new field. I'll call mine gCurrentIDs. Before you click "Create", click the radio button for global. When you click "Create" choose text as the type of global field.

Create a new relationship, almost identical to the relationship you have for these two files, in that the file and the right hand field are going to be the same. The left hand field, however, will be the global field you just created. I'll call my relationship "Global" for the script below.

Create a new layout in your database which has only the ID field that the relationship is based on. Never put any other fields on this layout. I'm going to call it "ID List"

If you don't have a developer layout, create one, and place the global field on it. I'll call mine "Developer" for the script below.

Create a script that is run _after_ you have your found set:

Go to Layout [ ID List ]

Copy All Records

Go to Layout [ Developer ]

Paste [ Select/perform, gCurrentIDs ]

Go to Related Record [ Show only related records, Global ]

  • Author

Hello,

Thanks... I have it working now.

One question. On the ID List layout, only the key field is allowed, but on the Developer layout other fields ar also allowed. Is that correct?

Greetings, Eric

quote:

Originally posted by erc:

Hello,

Thanks... I have it working now.

One question. On the ID List layout, only the key field is allowed, but on the Developer layout other fields ar also allowed. Is that correct?

Greetings, Eric

That's correct. The reason is that the Copy All Records command copies all the fields on the layout for all the records in the found set, using returns to separate the records. We only want to copy the ID field, so we don't ever want to place any other fields on this layout.

To paste the information we just copied, we just need to have the field on the current layout. The Developer layout is good for this, as it's a common place to put developer related fields, which our global is. Once you've pasted the information into the global field, you don't need to stay on that layout.

Chuck

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.