Events.RemoveEvent
------------------

Removes an event from the calendar store.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Events](component_Events.md) | [6.2](newinversion62.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "Events.RemoveEvent"; EKEvent; Span { ; Commit } ) 

**MBS**( **"Events.RemoveEvent";** /\* Removes an event from the calendar store. \*/  
**$EKEvent**; /\* The reference to the event.e.g. $event \*/   
**$Span**; /\* The span to use.  
This event, or this and future events.  
Pass "This" or "Future" here.e.g. "This" \*/   
**$Commit**) /\* Optional; Whether to commit.  
Pass 1 to commit or 0 to not commit.  
Default is 1.  
Pass 0 to batch changes together and commit with [Events.Commit](EventsCommit.md) later.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| EKEvent | The reference to the event. | $event |  |
| Span | The span to use.   This event, or this and future events.   Pass "This" or "Future" here. | "This" |  |
| Commit | Whether to commit.   Pass 1 to commit or 0 to not commit.   Default is 1.   Pass 0 to batch changes together and commit with [Events.Commit](EventsCommit.md) later. | 1 | Optional |

### Result

Returns OK or error.

### Description

Removes an event from the calendar store.  
This function attempts to remove the event from the calendar database. It returns OK if successful and error otherwise. It's possible for this function to return failed. This occurs if the event wasn't ever added and didn't need removing.  
After an event is removed, it is no longer tied to this calendar store, and all data in the event is cleared except for the eventIdentifier.  
  
You may still need to call [Events.Commit](EventsCommit.md) later.  
### Examples

Remove event:

 Set Variable \[$r ; Value:MBS ("Events.RemoveEvent"; CalendarTest::ItemUID ; "this"; 1)\]  
### See also

- [Events.Commit](EventsCommit.md)
- [Events.SaveEvent](EventsSaveEvent.md)
- [Events.SelectEvent](EventsSelectEvent.md)

### Release notes

- **Version 14.5**
    - Fixed a problem with [Events.Reset](https://www.mbsplugins.eu/EventsReset.shtml) with not clearing all cached events, so [Events.RemoveEvent](https://www.mbsplugins.eu/EventsRemoveEvent.shtml) function failed.

### Example Databases

- [Mac and iOS/Events/Events Sync](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Events/Events%20Sync.shtml#10ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 14.5pr6](https://www.mbsplugins.de/archive/2024-11-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 3/2020, Seite 40](https://filemaker-magazin.de/neuigkeit/4096-Appetithappen-FMM_202003)

This function checks for a license.

Created 10th March 2016 , last changed 17th March 2021

  
[Events.RemoveCalendar](EventsRemoveCalendar.md) - [Events.RemoveReminder](EventsRemoveReminder.md)

[HTML Version](EventsRemoveEvent.shtml)