Jump to content

newPerformScriptCommand and Script Errors


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

Recommended Posts

I'm trying to understand what could generate an error when performing a FileMaker script from via the PHP API using the newPerformScriptCommand command, e.g.

$scriptObject = $fm->newPerformScriptCommand($layoutName, $scriptName, $scriptParams);
// Execute the script
$scriptResult = $scriptObject->execute();

	if(FileMaker::isError($scriptResult)) {
	// FileMaker PHP API Error -- Alert User.
	$scriptError = 'Perform Script Error: '. $scriptResult->getMessage() . ' (' . $scriptResult->code . ')';
	} else {
	// no error - continue on
	}

I realise that if any of the newPerformScriptCommand parameters have errors like an invalid layout name or script name it will return an error, but I'm more interested in when the actual FileMaker script encounters an error when will it cause $scriptResult to return an error? For example I was just using this to call a FileMaker script - there was an issue with the FileMaker privileges for a table I was trying to create records in, but the script executed correctly as far as the PHP API was concerned. I only found out about the issues by looking at the Log Viewer in the FileMaker Server Admin Console after noticing the records were not being created.

Is there a way to exit the FileMaker Script with a script result that will generate an error with the $scriptResult? Do any FileMaker Script steps cause errors that will lead to an error result when executing the newPerformScriptCommand command? 

Link to comment
Share on other sites

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