Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1    Statistic  


Registers a javascript function.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
JavaScript 5.4 Yes No Yes, macOS only No Yes
MBS( "JavaScript.RegisterFunction"; JavaScriptContext; FunctionName { ; ParameterNames; Body; SourceURL; startingLineNumber } )   More


Parameter Description Example value
JavaScriptContext The reference number of the javascript context. $Context
FunctionName The name for the new function. "test"
ParameterNames Optional
The names for the parameters.
Body Optional
The body of the function.
"return value;"
SourceURL Optional
A text containing a URL for the script's source file. This is only used when reporting exceptions. Pass empty text if you do not care to include source file information in exceptions.
startingLineNumber Optional
An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. The value is one-based, so the first line is line 1 and invalid values are clamped to 1.


Returns OK or error.


Registers a javascript function.


Register a function:

Set Variable [$r; Value:MBS( "JavaScript.RegisterFunction"; $$Context; "Test"; "Value¶Count"; "return Value * Count;")]

See also

Example Databases

Created 7th November 2015, last changed 7th November 2015

JavaScript.RegisterEvaluateFunction   -   JavaScript.RegisterRunScriptFunction

Feedback: Report problem or ask question.

MBS Xojo PDF Plugins