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: 10.0   10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3    Statistic    FMM    Blog  

JS.CallFunctionValues

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.CallFunctionValues"; JSRef; Name; Parameters... )   More

Parameters

Parameter Description Example
JSRef The JavaScript reference number. $js
Name The name of the function. "test"
Parameters... Value to pass as parameter.

Result

Returns value or error.

Description

Calls a global function given the name with FileMaker values.
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.

Returns the result of the function converted to FileMaker, e.g. as text or number value.

If you like to use JSON instead, please use JS.CallFunction. Or pass JSON as string and let JavaScript decode it as part of the function.

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 function with values:

MBS( "JS.CallFunctionValues"; $$js; "Concat"; "Hello"; "World" )

Example result: Hello World

Call Concat function:

// this
MBS( "JS.CF"; "Concat"; Value1, Value2)

// is same as
MBS( "JS.CallFunctionValues"; "js"; "Concat"; Value1, Value2)

// which is same as
MBS( "JSON.GetValue"; MBS( "JS.CallFunction"; "js"; "Concat"; MBS( "JSON.CreateValue"; Value1 ), MBS( "JSON.CreateValue"; Value2 )))

See also

Release notes

  • Version 11.3
    • Added JS.List and JS.CallFunctionValues function.

Created 4th June 2021, last changed 11st June 2021


JS.CallFunction - JS.Evaluate

Feedback: Report problem or ask question.




Links
MBS Xojo blog

Start Chat