deleteReplicatedDataset

Deletes a specific CRM Analytics replicated dataset by ID.

Syntax 

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

CRM Analytics API Resource 

1DELETE /wave/replicatedDatasets/${id}

deleteReplicatedDataset uses this CRM Analytics API resource.

Parameters 

Parameter NameTypeDescriptionRequired?
idStringThe ID of the replicated dataset.Yes

Returns 

The return type is void.

Usage 

There are several ways to use deleteReplicatedDataset. For example, you can display a list of replicated datasets and enable delete on each replicated dataset on the list.

This example adds a delete button to a page with replicated datasets. Deleting a replicated dataset displays a toast message using the lightning/platformShowToastEvent module.

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

This button calls the deleteReplicatedDataset() 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.