Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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!

Posted

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.

Posted

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.

This topic is 3943 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.