Development Guide

Table Of Contents
36 FileMaker Pro Advanced Development Guide
Using the example plug-in
To access the external functions:
1. Open a file.
2. Open the Preferences dialog box.
Windows: Choose Edit menu > Preferences.
Mac OS X: Choose FileMaker Pro Advanced application menu >
Preferences.
3. Click the Plug-Ins tab.
4. Select FMExample.
Because the example plug-in includes a function that requires
configuration, the Configure button is enabled.
5. Click Configure.
The configuration dialog box that appears depends on how the plug-
in source code was written. The XMpl_UserFormatNumber function
in the FMExample plug-in displays the following configuration
dialog box.
6. Click OK to use the default format or type a new format.
The “#” symbols are replaced by numbers. All other text in the format
string is retained as is.
7. Click OK to close the Preferences dialog box.
8. With your file still open, in FileMaker Pro Advanced, choose
Manage menu > Database > Fields tab.
9. Create a calculation field.
10. In the Specify Calculation dialog box, choose External Functions
from the View drop-down list.
11. Double-click an external function to add it to the formula box.
All external function calls require the name of the external function to
call and the function’s parameter value, even if the value is null.
12. Replace the parameter placeholder with the required parameter or
parameters for the function.
13. Continue to build the formula then and click OK when you’re
done.
XMpl_StartScript
(filename; scriptname)
Runs the script specified by the scriptname
parameter on the file specified by the filename
parameter.
XMpl_Version Returns the version of the plug-in. It has no
parameters.
Note A version function similar to the one
provided in the example plug-in is required for
every FileMaker Pro plug-in.
XMpl_UserFormatNumber
(textOrNumber)
Returns the parameter as a text string formatted as
specified in the configuration dialog box. Use this
function to format text or numbers such as
telephone numbers, postal codes, and so on.
Formatting proceeds from right to left. Each #
symbol in the format string is replaced by the next
character in the parameter string. All remaining #
symbols are replaced with zeros.
This function demonstrates both client-only
functionality and the plug-in configuration dialog.
XMpl_FormatNumber
(formatString;
textOrNumber)
The same as XMpl_UserFormatNumber, but
formatString is provided as a parameter. This
function illustrates a function that is visible in the
Specify Calculation dialog for Auto Entry, and also
supports calls from FileMaker Server, and
Instant Web Publishing.
Function’s name
and parameter Description of external function