SharingService.SetTrigger
-------------------------

Sets a trigger to call for the share.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SharingService](component_SharingService.md) | [10.3](newinversion103.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "SharingService.SetTrigger"; FileName; ScriptName ) 

**MBS**( **"SharingService.SetTrigger";** /\* Sets a trigger to call for the share. \*/  
**$FileName**; /\* The database file name where the script is located.e.g. "test.fmp12" \*/   
**$ScriptName**) /\* The script name.e.g. "MyScript" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| FileName | The database file name where the script is located. | "test.fmp12" |
| ScriptName | The script name. | "MyScript" |

### Result

Returns OK or error.

### Description

Sets a trigger to call for the share.  
This is called once after you call [SharingService.ShareItems](SharingServiceShareItems.md) to report the result, but only if [SharingService.ShareItems](SharingServiceShareItems.md) returns OK.   
You get a script parameter with a JSON containing a status key with the status, either success, cancel or failed. We include error dictionary with details on a failure and service key with details on the service.  
### See also

- [SharingService.ShareItems](SharingServiceShareItems.md)

### Example Databases

- [Mac only/Sharing Services](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/Sharing%20Services.shtml#2ScriptAnchor_)

### Blog Entries

- [What is new in the MBS FileMaker Plugin Version 10.3](https://www.mbsplugins.de/archive/2020-07-31/What_is_new_in_the_MBS_FileMak/monkeybreadsoftware_blog_filemaker)
- [Using Sharing Services in MacOS with FileMaker](https://www.mbsplugins.de/archive/2020-06-29/Using_Sharing_Services_in_MacO/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 27th June 2020 , last changed 27th June 2020

  
[SharingService.SetEmailSubject](SharingServiceSetEmailSubject.md) - [SharingService.ShareHTML](SharingServiceShareHTML.md)

[HTML Version](SharingServiceSetTrigger.shtml)