Chapter 2 | Preparing databases for Custom Web Publishing 18
FileMaker scripts and Custom Web Publishing
The Manage Scripts feature in FileMaker Pro can automate frequently performed tasks and
combine several tasks. When used with Custom Web Publishing, FileMaker scripts allow web
users to perform more tasks or a series of tasks.
FileMaker supports many script steps in Custom Web Publishing. Web users can perform a variety
of automated tasks when you use scripts in a query string for a URL. To see script steps that
Custom Web Publishing supports, in the FileMaker Pro Script Workspace window, click the
Compatibility button and choose Custom Web Publishing. Script steps that are not dimmed are
supported for Custom Web Publishing. For information on creating scripts, see FileMaker Pro
Help.
Script tips and considerations
Although many script steps work identically on the web, there are several that work differently. See
“Script behavior in Custom Web Publishing solutions” on page 19. Before sharing your database,
evaluate all scripts that will be executed from a web browser. Be sure to log in with different user
accounts to make sure they work as expected for all clients. Check the Web Publishing Engine log
file (wpe.log) for any scripting-related errors. See “Using the Web Publishing Engine log” on
page 94.
Keep these tips and considerations in mind:
1 Consider what values a script may return. Be prepared to handle all of the data that is returned.
In FileMaker Pro, a script may return all the records from a table or from the current found set.
But if a script returns all the records from a table, a web application may run out of memory
trying to processing the records. Consider using the –max query parameter with XML queries
or the setRange()method with PHP queries to limit the number of records returned.
1 Use accounts and privileges to restrict the set of scripts that a web user can execute. Verify that
the scripts contain only web-compatible script steps, and only provide access to scripts that
should be used from a web browser.
1 Consider the side effects of scripts that execute a combination of steps that are controlled by
access privileges. For example, if a script includes a step to delete records, and a web user
does not log in with an account that allows record deletion, the script will not execute the Delete
Records script step. However, the script might continue to run, which could lead to unexpected
results.
1 In the Script Workspace window, grant full access privileges to a script to allow the script to
perform tasks that you would not grant individuals access to. For example, you can prevent
users from deleting records with their accounts and privileges, but still allow them to run a script
that would delete certain types of records under conditions predefined within a script.
1 To allow scripts to install plug-ins for Custom Web Publishing and FileMaker WebDirect
solutions, use FileMaker Server Admin Console to enable the setting Allow Install Plug-In File
script step to update plug-ins for web publishing. To prevent script from installing plug-ins
for web publishing solutions, clear this setting.
1 Some scripts that work with one step from a FileMaker Pro client may require an additional
Commit Record/Request script step to save the data to the host. Because web users don’t have
a direct connection to the host, they aren’t notified when data changes. For example, features
like conditional value lists aren’t as responsive for web users because the data must be saved
to the host before the effects are seen in the value list field.