deleteDataConnector

Deletes a specific CRM Analytics data connector by ID or developer name.

Syntax 

1import { deleteDataConnector } from 'lightning/analyticsWaveApi';
2deleteDataConnector({ connectorIdOrApiName: string }): Promise<void>

CRM Analytics API Resource 

1DELETE /wave/dataConnectors/${connectorIdOrApiName}

deleteDataConnector uses this CRM Analytics API resource.

Parameters 

Parameter NameTypeDescriptionRequired?
connectorIdOrApiNameStringThe ID or developer name of the connector.Yes

Returns 

The return type is void.

Usage 

There are several ways to use deleteDataConnector. For example, you can display a list of connectors and enable delete on each connector on the list.

This example adds a delete button to a page with data connectors. Deleting a connector displays a toast message using the lightning/platformShowToastEvent module.

1import { LightningElement, api } from "lwc";
2import { deleteDataConnector } from "lightning/analyticsWaveApi";
3import { ShowToastEvent } from "lightning/platformShowToastEvent";
4
5export default class DeleteDataConnector extends LightningElement {
6  @api idOrApiName; // or fetch the ID or developer name
7
8  delete(event) {
9    deleteDataConnector({ connectorIdOrApiName: this.idOrApiName })
10      .then(() => {
11        this.dispatchEvent(
12          new ShowToastEvent({
13            title: "Success",
14            message: "Connector Deleted",
15            variant: "success",
16          }),
17        );
18      })
19      .catch((error) => {
20        this.dispatchEvent(
21          new ShowToastEvent({
22            title: "Error deleting connector",
23            message: error.body.message,
24            variant: "error",
25          }),
26        );
27      });
28  }
29}

This button calls the deleteDataConnector() method.

1<template>
2  <lightning-button
3    label="Delete"
4    icon-name="utility:delete"
5    icon-position="right"
6    onclick={delete}
7  >
8  </lightning-button>
9</template>

Release Preview

This release is in preview. Features described here don't become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can't guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.