Monday, November 16, 2009

Troubleshooting FileMaker PHP Issues

The team at Insightful Systems also develop web based interfaces for FileMaker databases. This allow our clients and their end-customers to access FileMaker data across the Internet via a web browser. As with most new skills, there was a learning curve that required a degree of trial and error from the development team.

Unlike development in FileMaker where calculations and scripts are validated as you go, PHP pages are written in a text editor and are only compiled when the page is accessed via a web browser. It's therefore not apparent whether the PHP page you've developed will work correctly until the page is loaded into the web browser. When errors do occur accessing the PHP page, the FileMaker API returns an error code which can be checked against the list of known FileMaker error codes.

Provided below is a selection of error messages we encountered during the PHP development process and the root cause discovered. As you'll see from these examples, the error messages returned don't always provide a clear pointer to the underlying cause.

Error 5: Command is invalid (for example, a Set Field script step does not have a calculation specified)

The actual cause of this problem (on this occasion) was the incorrect specification of the layout name.

Error 201: Field cannot be modified
Sometimes calculation fields are inadvertently included on forms that are used to create or edit information in the database. The error message above is returned when attempting to update a field that is a calculation field as it cannot be updated manually.

Error 104: Script is missing
While the error code indicates a script is missing the script being called did exist in the database and could be executed manually. Further investigation found that the user account being used to login to the web application (by some users) did not have privilege to run the relevant script.

Insight gained
When troubleshooting issues relating to your FileMaker web applications think in terms of a user accessing the database directly using the FileMaker Pro client software.

  1. Account privileges - Does the login account being used have the privilege to perform the required actions on the specified tables?
  2. Layout - Has the layout name been spelled correctly? Do you use the right layout? Make sure the user account that is used for this query has the permissions to access this layout.
  3. Field - Is the field required included on the layout specified?

If the user can't carry out the required action directly in FileMaker they won't be able to do it via the web.

No comments:

Post a Comment