Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   7.6    Statistic  

JavaScript.RegisterFunction

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 } )

Parameters

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.
"Value¶Count"
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.
1

Result

Returns OK or error.

Description

Registers a javascript function.

Examples

Register a function:

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

See also

Example Databases


JavaScript.RegisterEvaluateFunction   -   JavaScript.RegisterRunScriptFunction

Feedback: Report problem or ask question.




Links
MBS FileMaker tutorial videos