JavaScript.CF
-------------

Calls a global function given the name with FileMaker values.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [JavaScriptWebKit](component_JavaScriptWebKit.md) | [12.2](newinversion122.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "JavaScript.CF"; Name; Parameters... ) 

**MBS**( **"JavaScript.CF";** /\* Calls a global function given the name with FileMaker values. \*/  
**$Name**; /\* The name of the function.e.g. "test" \*/   
**$Parameters...**) /\* Value to pass as parameter. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Name | The name of the function. | "test" |
| Parameters... | Value to pass as parameter. |  |

### Result

Returns value or error.

### Description

Calls a global function given the name with FileMaker values.  
Please initialize the global "js" JavaScript environment before (see [JavaScript.New](JavaScriptNew.md)) and fill it with function definitions as needed (see [JavaScript.RegisterFunction](JavaScriptRegisterFunction.md)). This may include functions to do FileMaker evaluate (see [JavaScript.RegisterEvaluateFunction](JavaScriptRegisterEvaluateFunction.md)), SQL execute (see [JavaScript.RegisterSQLQueryFunction](JavaScriptRegisterSQLQueryFunction.md)) and starting scripts (see [JavaScript.RegisterRunScriptFunction](JavaScriptRegisterRunScriptFunction.md)).  
  
Parameters are passed to the function. Please pass as many parameters in FileMaker as needed.  
Numbers are passed as number and other values are passed as text.  
  
If the function needs more parameter, undefined values are used to fill up.  
If the function needs less parameters, additional ones are dropped.  
There is no limit in the number of parameters for MBS Plugin here.  
  
Returns the result of the function converted to FileMaker, e.g. as text or number value.  
  
Same as [JavaScript.CallFunction](JavaScriptCallFunction.md), but takes "js" as the global JavaScript engine. See our example for JavaScript Custom Functions.  
  
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.  
Please repeat Parameters parameter as often as you need.  
### See also

- [JavaScript.CallFunction](JavaScriptCallFunction.md)
- [JavaScript.New](JavaScriptNew.md)
- [JavaScript.RegisterEvaluateFunction](JavaScriptRegisterEvaluateFunction.md)
- [JavaScript.RegisterFunction](JavaScriptRegisterFunction.md)
- [JavaScript.RegisterRunScriptFunction](JavaScriptRegisterRunScriptFunction.md)
- [JavaScript.RegisterSQLQueryFunction](JavaScriptRegisterSQLQueryFunction.md)

### Release notes

- **Version 12.2**
    - Added [JavaScript.CF](https://www.mbsplugins.eu/JavaScriptCF.shtml) function for using this JavaScript engine for custom functions, too.

### Example Databases

- [JavaScript WebKit/JavaScriptMac Custom Functions](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/JavaScript%20WebKit/JavaScriptMac%20Custom%20Functions.shtml#12912FieldAnchor_)

### Blog Entries

- [MBS FileMaker Plugin 12.2](https://www.mbsplugins.de/archive/2022-06-09/MBS_FileMaker_Plugin_122/monkeybreadsoftware_blog_filemaker)
- [Neues MBS Plugin 12.2 für Claris FileMaker](https://www.mbsplugins.de/archive/2022-05-17/Neues_MBS_Plugin_122_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 12.2 for Claris FileMaker](https://www.mbsplugins.de/archive/2022-05-17/MBS_Plugin_122_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [Custom Functions in JavaScript reloaded](https://www.mbsplugins.de/archive/2022-05-05/Custom_Functions_in_JavaScript/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.2pr5](https://www.mbsplugins.de/archive/2022-05-04/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 3th May 2022 , last changed 9th February 2023

  
[JavaScript.Available](JavaScriptAvailable.md) - [JavaScript.CallFunction](JavaScriptCallFunction.md)

[HTML Version](JavaScriptCF.shtml)