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.

Featured Replies

I have a script that performs a find based on related fields.  Here's a very simplified version of script

 

Go To Layout ["Primary_Table"]

Enter Find Mode []

Set Field [related_table::name]

Perform Find

 

I have the <<related_table::name>> field on the Primary_Table layout.

 

If I run this within Filemaker Pro it works and finds desired subset.  If I run it as a Server script it works and finds desired subset.  But, if I trigger it from PHP it finds ALL the records in the Primary_Table.  The following, however, does work and finds a subset of records from Primary_Table:

 

Go To Layout ["Primary_Table"]

Enter Find Mode []

Set Field [Primary_Table::id]

Perform Find

 

In other words, I can trigger scripts with PHP that successfully do finds when all the find fields are native to the Primary_Table, but as soon as I try to add criteria that's in a related table to Primary_Table it finds ALL Primary Table records.

 

I've tried authorizing all layouts to the php user so I don't think it's a permissions issue.

 

Is this a known issue, or should it work in principal and I'm missing something?

 

Hopefully not since otherwise it's going to mean a much longer script to find what I need (the actual script does a search using fields from 3 different related tables, 2 of which are 3 tables away from Primary_Table, so I'll need to do a ton of Go To Related Records steps.

 

Thanks for the help!

Since FileMaker's PHP API is layout-centered, you can't use it to find records in the way you described. I find it easier to create a PHP-specific layout based on the child table (with the PrimaryTable::keyfield on it), and perform the find in that layout with the PHP API's newFindCommand() function. Repeat as needed for the other child tables, and concatenate the returned arrays.

  • Author

Turns out I had missed a permission on one of the related tables which was breaking my find.  So, you can, in fact, trigger filemaker scripts with PHP that perform finds using find criteria in fields of a related_table to the Primary_Table.

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.