---
schema_version: "1"
id: f2577853331ea4b15614566cd6f9b60b408cc8f4dc04346a2fc8420dbce19610
title: removeEvent(event, options)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lwc/lwc/guides/reference/calendarservice/reference-lightning-calendarservice-removeevent.md
canonical_url: https://developer.salesforce.com/docs/platform/lwc/guide/reference-lightning-calendarservice-removeevent.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7ad4b635ae21b9f5b6a83a490d58fff4b00405af10bd383f707354d04addf280
products:
  - Lightning Web Components Developer Guide
  - lwc
---
# `removeEvent(event, options)`

Removes an event from a device’s calendar.

**note:** Using `removeEvent()` is an inherently dangerous action, as it allows event data to be irreversibly deleted. Use caution when using this functionality in your component. At an absolute minimum, consider adding a confirmation window for your users that clearly states the outcome of the action, with an option for them to cancel if they wish.

## Syntax

```
import { getCalendarService } from 'lightning/mobileCapabilities';
removeEvent(event: Event,
  options: CalendarServiceOptions
  ): Promise<Object>
```

## Parameters

- `event`—(Required) The `Event` object to be removed from the device’s calendar.
- `options`—(Required) A [`CalendarServiceOptions`](https://developer.salesforce.com/docs/platform/lwc/guide/reference-lightning-calendarservice-data-types.md) object to configure the CalendarService request.

## Returns

If successful, nothing is returned. If unsuccessful, an error message is returned.

## Usage

Use this function to remove an event from a device’s calendar.

```javascript
myCalendarService
  .removeEvent(event, options)
  .then((results) => {
    console.log("Event successfully removed!");
  })
  .catch((error) => {
    console.error("Error code: " + error.code);
    +console.error("Error message: " + error.message);
  });
```
