FM PHP – execute script

Place button(s) on FileMaker API PHP page to execute FM script is special task.

FM API include PerformScriptCommand:

Picture 3
PHP is server-based language, so script typically will be executed on page load. On every page load. That can cause problems – you may be needn’t to run script on every page load.

In typical configuration – edit.php, browse.php, list.php etc. – including above code cannot be triggered via Button on page.

To solve this I include new page – script.php. On this page I include above code.

Finally :

Button Picture 2

Code included in script.php

Picture 4

Here ‘Npk’ is value from field representing record number – auto enter serial – passed as script parameter. ‘List’ is script name.

script.php HEAD contain

Picture 5
Main problem is  - for each script a separate php page must be written (one button-one page).

Sample download.

Posted on August 29, 2009 at 23:44 by Peter · Permalink
In: FileMaker, products · Tagged with: ,