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.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4    Statistic  

JavaScript.RegisterEvaluateFunction

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 )

Parameters

Parameter Description Example value
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

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


JavaScript.New   -   JavaScript.RegisterFunction

Feedback: Report problem or ask question.




Links
MBS FileMaker blog