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.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4    Statistic    FMM    Blog  

JS.AddFileMakerEvaluateFunction

Adds an Evaluate function.

Component Version macOS Windows Linux Server iOS SDK
JavaScript 10.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "JS.AddFileMakerEvaluateFunction"; JSRef; Name )   More

Parameters

Parameter Description Example
JSRef The JavaScript reference number. $js
Name The name of the function. "test"

Result

Returns OK or error.

Description

Adds an Evaluate function.
The function will take string parameter and evaluate the result in FileMaker. Result is returned as text to JavaScript.

For increased security we prefer all FileMaker developers define their own function name, so if you get some foreign JavaScript, it can't know the function name and mess with FileMaker.

Examples

Evaluate something with FileMaker in JavaScript:

Set Variable [ $js ; Value: MBS( "JS.New" ) ]
Set Variable [ $r ; Value: MBS( "JS.AddFileMakerEvaluateFunction"; $js; "FMEval") ]
Show Custom Dialog [ "Result" ; MBS( "JS.Evaluate"; $JS; " \"got AccountName: \" + FMEval(\"Get(AccountName)\")" ) ]
Set Variable [ $r ; Value: MBS( "JS.Release"; $JS ) ]

Create a JavaScript Environment with a FMEval function:

Set Variable [ $$JS ; Value: MBS("JS.New") ]
Set Variable [ $r ; Value: MBS( "JS.AddFileMakerEvaluateFunction"; $$js; "FMEval") ]

See also

Example Databases

Blog Entries

Created 7th December 2019, last changed 13th June 2021


IsWindows - JS.AddFileMakerRunScriptFunction

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins

Start Chat