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.

If there is no relationship

Featured Replies

I have a couple FM files from pre 7 days. The files are related to each other but there are no portals in either file.

What I would like to do is create a script in one file that will take me to the related record in the other file if there *IS* a related record. If there is *NO* related record then I want go just go to the file anyway and browse all records.

Here is my script with all of the fluff removed:

Set Error Capture On

Go To Related Record

If Get ( Last Error ) = 101 // no related record

Open File ["The Other File"]

End If

When I run the script, if there is actually a related record it seems to locate it but the window never becomes active. It think this is because the script in the source file is not finished. The same thing happens if there is no related file. It probably goes there but comes back to the original file to finish the "End IF" statement.

I've hit this problem in the past and came up with some pretty clunky workarounds which I would like to avoid this time. I'm hoping one of you more experienced developers can show me how you would handle this situation.

In pre-7 FileMaker activates the file the script (or chain of scripts) ends in. That is to activate the related file in your situation you need have some "Open me" script in The Other File and either

- Call it at the end of your script, or

- Call "Open me" from any place, but add a Halt step to it.

  • Author

Mikhael,

Thanks for the help but I may have confused the issue by mentioning the the database was designed before version 7. It is now in fact on version 7. It was converted to v7 last year. I only mentioned that to illustrate that the tables are in different files. I guess I confused the problem and I should have been more clear.

I did try adding a couple of HALTs but it's not working for me either. Again, I'm thinking it is because they are inside if the "IF" which means that the script has to return to the source file to complete.

Becky

Try something like this.

If [ IsEmpty ( File_two::PrimaryKeyID ) ]

Open File ["File2"]

Perform Script [ "ShowAll" from File: "File2" ]

Else

Go to Related Record [ Show Only Related Records; From table: "File2"; External; Using Layout "Layout1" (File2) ]

End If

Also I would recommend that if possible, either merge all file that need to be merged. Or, copy the layouts from the second file into the main file and have a Table Occurence represent the second external file.

By doing it this way, you can call the script in and do your checking via the Main file.

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.