Reputation: 321
I have a question regarding the filemaker 12 php api.
I'm trying to run a script which sets a field which in turn determines which records are shown on the filemaker layout. It appears as though no matter what parameter I send into the script the field is set to a default value of 1.
The script runs correctly in filemaker and I also tried hardcoding a different value in the filemaker script and that also worked as excepted.
I new to filemaker, so I'm mystified as to why calling the script from php doesn't work the same as calling it from filemaker.
This is my php code:
$newPerformScript = $fm->newPerformScriptCommand($layout_name, $script_name, $parameter);
$result = $newPerformScript->execute();
$result_record = $result->getFirstRecord();
//The data I'm retrieving is in this related set
$related_set =& $result_record->getRelatedSet($related_set_name);
Any help that can be provided would be appreciated.
Upvotes: 0
Views: 3693
Reputation: 45
Hmm, there's a few things:
Check that the account/password you are using has a privilege set that gives it all the permissions required to run the script successfully, including access to any records and fields you need in related tables. Don't forget to include permissions to any fields used as match-keys in relationships. If permission is denied to these fields, you won't get an error, but no records will be found.
Check that your script ends up on the correct layout (one that your web account has permissions to view)
If you are getting related records, you need to have a portal corresponding to the required relationship on the layout you are using, in order to retrieve the records.
Upvotes: 0