Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
JS.CF
Calls a global function given the name with FileMaker values.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
JavaScript | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "JS.CF"; Name { ; Parameters... } ) More
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
Name | The name of the function. | "test" | |
Parameters... | Value to pass as parameter. | Optional |
Result
Returns OK or error.
Description
Calls a global function given the name with FileMaker values.Please initialize the global "js" JavaScript environment before (see JS.New) and fill it with function definitions as needed (see JS.AddFunction). This may include functions to do FileMaker evaluate (see JS.AddFileMakerEvaluateFunction), SQL execute (see JS.AddFileMakerSQLFunction) and starting scripts (see JS.AddFileMakerRunScriptFunction).
Parameters are passed to the function. Please pass as many parameters in FileMaker as needed.
Numbers are passed as number and other values are passed as text.
If the function needs more parameter, undefined values are used to fill up.
If the function needs less parameters, additional ones are dropped.
There is no limit in the number of parameters for MBS Plugin here.
Returns the result of the function converted to FileMaker, e.g. as text or number value.
Same as JS.CallFunctionValues, but takes "js" as the global JavaScript engine. See our example for JavaScript Custom Functions.
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.
Please repeat Parameters parameter as often as you need.
Examples
Call Concat function:
MBS( "JS.CF"; "Concat"; Value1, Value2)
Call a function and pass field value, calculation and hard coded value:
MBS( "JS.CF"; "Test"; MyTable::MyField; Get(AccountName); "Hello"; Round($Total + ($Total * $taxRate); 2) )
See also
- JS.AddFileMakerEvaluateFunction
- JS.AddFileMakerRunScriptFunction
- JS.AddFileMakerSQLFunction
- JS.AddFunction
- JS.CallFunction
- JS.CallFunctionValues
- JS.New
Release notes
- Version 11.3
- Added JS.CF and example database for custom functions with JavaScript.
Example Databases
Blog Entries
- New in MBS FileMaker Plugin 11.3
- Neues MBS FileMaker Plugin 11.3
- MBS FileMaker Plugin 11.3 - More than 6500 Functions In One Plugin
- MBS @ FMTraining.TV
- Custom Functions stored in a database
- Custom Functions in JavaScript
- MBS FileMaker Plugin, version 11.3pr2
FileMaker Magazin
This function checks for a license.
Created 4th June 2021, last changed 14th July 2022