Jump to content
Server Maintenance This Week. ×

Exiting to PHP with Filemaker Errors


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

Recommended Posts

Hi everyone,

I find myself in a bit of a predicament with the Filemaker PHP API.

I'm running some rather complex Filemaker scripts via the PHP API and need to be able to communicate a message back to PHP depending on various circumstances. It's imperative that I actually retrieve this 'string' back, since it's not necessarily a Filemaker Error, just a set of conditions that have not been satisfied.

I'm aware that you can't use an exit script step to send a Script Result back, and have tried a few alternatives mentioned on the forums about using a Global Field whose value would be passed back... However, in many cases, the script is checking up to 5 different layouts for data to be considered, and even if I handle each layout individually at each stage, there are times when an empty foundset is returned (count = 0 in the PHP object) so the Global Error obviously doesn't get returned.

I've looked at having an 'error' table that I somehow write to, but that means I would need to pass some form of identifier on every single call to Filemaker in order to be able to pull back any errors that might take place, for that particular user, in that particular session...

Basically, the question is: How can I get a message back from Filemaker to PHP that accounts for conditions where no foundset is returned?

I'd be very grateful for any help on this.

Best regards,

Jason

Link to comment
Share on other sites

Actually, after a bit more thought I came up with a solution - thought I'd document it in case anyone else ever has this problem.

The way I got around it, is when I write my internal error log in Filemaker for the errors I'm trying to capture, I pass a second parameter which determines if it is a 'fatal' error or not. Only fatal errors get returned to PHP. If it IS fatal, it constrains the current foundset (in the error table) to the current log record, and aborts the script (with a halt script step). In doing so, you get a record object with the error message.

Hope this helps someone one day!

Link to comment
Share on other sites

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