Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
JavaScript.RegisterFunction
Registers a javascript function.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| JavaScriptMac | 5.4 | Yes | No | No | Yes, macOS only | Yes |
MBS( "JavaScript.RegisterFunction"; JavaScriptContext; FunctionName { ; ParameterNames; Body; SourceURL; startingLineNumber } ) More
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| JavaScriptContext | The reference number of the javascript context. | $Context | |
| FunctionName | The name for the new function. | "test" | |
| ParameterNames | The names for the parameters. | "Value¶Count" | Optional |
| Body | The body of the function. | "return value;" | Optional |
| SourceURL | 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. | Optional | |
| startingLineNumber | 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 | Optional |
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
Created 7th November 2015, last changed 9th January 2020
JavaScript.RegisterEvaluateFunction - JavaScript.RegisterRunScriptFunction
Feedback: Report problem or ask question.
Links
MBS Xojo Chart Plugins