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:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
JavaScript.RegisterEvaluateFunction
Registers evaluate function.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| JavaScriptMac | 5.4 | Yes | No | No | Yes, macOS only | Yes |
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
- JavaScript.EvaluateScript
- JavaScript.New
- JavaScript.RegisterFunction
- JavaScript.RegisterRunScriptFunction
- JavaScript.RegisterSQLQueryFunction
- JavaScript.Release
Example Databases
Created 7th November 2015, last changed 9th January 2020
JavaScript.New - JavaScript.RegisterFunction
Feedback: Report problem or ask question.
Links
MBS Xojo tutorial videos