Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Plugin.RegisterScriptStep

Registers a script step dynamically.

Component Version macOS Windows Linux Server iOS SDK
Plugin 15.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Plugin.RegisterScriptStep"; Script Step ID; Name; Definition; Expression; Description { ; Flags } )   More

Parameters

Parameter Description Example Flags
Script Step ID The script step ID.
Must be unique and 3 or higher.

MBS function is ID 1 and MBS script step is ID 2.
3
Name The name of the custom function. "Concat"
Definition An XML to define the script step.
Expression The expression to run. "1+2"
Description The description to show in the user interface.
Flags The flags for the function. 0 Optional

Added in version 15.4.

Result

Returns OK or error.

Description

Registers a script step dynamically.
Allows you to define custom script steps for your solution.
Please register the same script step each time your solution opens with the same IDs. FileMaker usually finds script steps by ID.

See also Plugin.RegisterFunction for registering a function.

FlagDescription
0Evaluate with FileMaker
1Use Duktape JavaScript engine
2Use WebKit JavaScript engine if available (see JavaScript.Available) or fall back to Duktape.
4Add 4 to use a per thread JavaScript context, so globals are shared within the scripts running on tha thread. in FileMaker Pro you only have one thread, but on server, you may have multiple threads.
8Add 8 to secure the script step and prevent it from being unregistered or replaced.

If you use JavaScript, you should declare a function in JavaScript to take the right number of parameters. Your function should return a result as text, boolean or number. If you have objects or arrays, please use JSON.stringify function to serialize them to text. Your JavaScript can define additional things you use in your function.

Examples

Register a script step:

MBS( "Plugin.RegisterScriptStep";
// internal ID. Must be unique
123;
// name of script step
"Concat";
// XML definition of parameters
"<PluginStep>
    <Parameter Type=\"target\" Label=\"Destination\" ShowInLine=\"true\"/>
    <Parameter Type=\"calc\" DataType=\"text\" ShowInline=\"true\" Label=\"FirstName\" ID=\"0\"/>
    <Parameter Type=\"calc\" DataType=\"text\" ShowInline=\"true\" Label=\"SecondName\" ID=\"1\"/>
</PluginStep>";
// calculation
"MBS(\"Plugin.ScriptStepParameter\"; 0) & MBS(\"Plugin.ScriptStepParameter\"; 1)";
// description
"Concat two texts" )

See also

Release notes

Blog Entries

This function checks for a license.

Created 27th June 2025, last changed 2nd October 2025


Plugin.RegisterFunction - Plugin.ScriptStepParameter