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

Plugin.RegisterFunction

Registers a custom function.

Component Version macOS Windows Linux Server iOS SDK
Plugin 15.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Plugin.RegisterFunction"; functionId; Name; Prototype; Expression { ; MinParameter; MaxParameter } )   More

Parameters

Parameter Description Example Flags
functionId The function ID.
Must be unique and 3 or higher.

MBS function is ID 1 and MBS script step is ID 2.
123
Name The name of the custom function. "Concat"
Prototype The prototype to show in the user interface.
Defines the names of parameters.
"Concat(a, b)"
Expression The expression to run. "1+2"
MinParameter The minimum parameter count. 0 Optional
MaxParameter The maximum parameter count.
Pass -1 for unlimited parameters.
2 Optional

Result

Returns OK or error.

Description

Registers a custom function.
Allows you to define custom functions for your solution, which are accessible from all files.

Please register the same function each time your solution opens with the same IDs. FileMaker usually finds functions by ID, but with Evaluate() it matches them by name.

If you take variable number of arguments, you need to use Plugin.CustomFunctionParameter function.

Examples

Register custom function:

# Register one function. Replacing older one with same id
Set Variable [ $r ; Value: MBS("Plugin.RegisterFunction";
    123; // ID to use
    "Concat"
    "Concat(Value1; Value2)";
    "Value1 & Value2";
    2; // min and max parameters
    2) ]
If [ MBS("IsError") ]
    Show Custom Dialog [ "Failed to add function." ; $r ]
End If

See also

Release notes

  • Version 15.3
    • Improved Plugin.RegisterFunction to pass parameters as they appear in prototype.
    • Added Plugin.RegisterFunction function to register custom functions on the fly. These show up in calculation dialogs just like regular custom functions.

Blog Entries

This function checks for a license.

Created 26th June 2025, last changed 7th July 2025


Plugin.PrepareForUpdate - Plugin.RegisterScriptStep