fm_perform_script
mixed fm_perform_script ( string $file_name
, string $script_name
[, string $script_parameter
[, int $control
]] )
Description
Allows you to trigger FileMaker scripts from within your PHP code.
Notes:
- The PHP code must complete execution before any scripts will be triggered.
- If you're calling the PHP code from a script, that script must complete before any scripts will be triggered.
- If you make multiple calls to fm_perform_script, the scripts will be queued and performed in the order that you called them.
Parameters
file_name
(required)
The name of the file that contains the script to be performed. Can be left empty to default to the current file.
script_name
(required)
The name of the script to perform.
script_parameter
(optional)
The script parameter to be sent to the script. Note that SmartPill 3 supports sending containers in the script parameter.
control
(optional)
Tells FileMaker what to do if another script is running. Use one of the following control values: 0 = halt, 1 = exit, 2 = resume, 3 = pause (default). Any value other than 0, 1, 2 or 3 will be ignored and the default value 3 will be used.
Return
Returns 0 when the script is successfully triggered. Returns NULL when script triggering is disabled. If script triggering is disabled, fm_get_last_error will return 901 Script triggering is disabled.
Errors
fm_perform_script('Testbed', 'Test_Script', 'Hello'); /* Returns: 0 */
fm_perform_script('', 'Test_Script', 'Hello'); /* Notice that the file_name parameter is empty, this is okay, the current file name will be used Returns: 0 */
// Todo - https://scodigo.atlassian.net/browse/SGOSP-47
Change Log
Version | Description |
---|---|
3.0.0 | Containers can now be sent in the script parameter. |