Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1    Statistic  


Registers evaluate function.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
JavaScript 5.4 Yes No Yes, macOS only No Yes
MBS( "JavaScript.RegisterEvaluateFunction"; JavaScriptContext; FunctionName )   More


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


Returns OK or error.


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)")


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

Created 7th November 2015, last changed 25th November 2017

JavaScript.New   -   JavaScript.RegisterFunction

Feedback: Report problem or ask question.

MBS Xojo Plugins