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: 12.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4    Statistic    FMM    Blog  

JavaScript.RegisterEvaluateFunction

Registers evaluate function.

Component Version macOS Windows Linux Server iOS SDK
JavaScriptWebKit 5.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "JavaScript.RegisterEvaluateFunction"; JavaScriptContext; FunctionName )   More

Parameters

Parameter Description Example
JavaScriptContext The reference number of the javascript context. $Context
FunctionName The name for the new function. "Evaluate"

Result

Returns OK or error.

Description

Registers evaluate function.
The javascript function takes one parameter which is expression to evaluate. Returns the text of the expression result.
Call later like this: FMEvaluate("Get(AccountName)")

Examples

Register function:

MBS( "JavaScript.RegisterEvaluateFunction"; $$Context; "FMEvaluate" )
# later:
# FMEvaluate("Get(AccountName)")

Evaluate in javascript the FileMaker get function:

Set Variable [ $js ; Value: MBS( "JavaScript.New" ) ]
Set Variable [ $r ; Value: MBS( "JavaScript.RegisterEvaluateFunction"; $js; "FMEvaluate" ) ]
Set Variable [ $r ; Value: MBS( "JavaScript.EvaluateScript"; $js; "FMEvaluate('Get(AccountName)') + ' from javascript'") ]
Show Custom Dialog [ "Result" ; $r ]
Set Variable [ $r ; Value: MBS( "JavaScript.Release"; $js ) ]

See also

Example Databases

Blog Entries

This function checks for a license.

Created 7th November 2015, last changed 9th February 2023


JavaScript.New - JavaScript.RegisterFunction

💬 Ask a question or report a problem