updateReplicatedDataset

Updates a CRM Analytics replicated dataset by ID.

Syntax 

1import { updateReplicatedDataset } from 'lightning/analyticsWaveApi';
2updateReplicatedDataset({ id: string, replicatedDataset: ReplicatedDatasetInput }): Promise<ReplicatedDataset>

CRM Analytics API Resource 

1PATCH /wave/replicatedDatasets/${id}

updateReplicatedDataset uses this CRM Analytics API resource.

Parameters 

Parameter NameTypeDescriptionRequired?
idStringThe ID of the replicated dataset.Yes
replicatedDatasetObjectThe replicated dataset information to update. Use a Replicated Dataset Input resource.Yes

Returns 

Usage 

There are several ways to use updateReplicatedDataset. For example, you can display a list of replicated datasets and update the connection mode, the full refresh setting, or the pass through filter.

This example adds an update button to a page with replicated datasets. The page must contain form elements for the information required to update the replicated dataset, like the connection mode. Updating a replicated dataset displays a toast message using the lightning/platformShowToastEvent module.

1import { LightningElement, api } from "lwc";
2import { updateReplicatedDataset } from "lightning/analyticsWaveApi";
3import { ShowToastEvent } from "lightning/platformShowToastEvent";
4
5export default class UpdateReplicatedDataset extends LightningElement {
6  @api rdId; // or fetch the ID of the replicated dataset
7  rdataset = {
8    connectionMode: "full",
9    fullRefresh: true,
10  };
11
12  update(event) {
13    updateReplicatedDataset({ id: this.rdId, replicatedDataset: this.rdataset })
14      .then(() => {
15        this.dispatchEvent(
16          new ShowToastEvent({
17            title: "Success",
18            message: "Replicated dataset updated",
19            variant: "success",
20          }),
21        );
22      })
23      .catch((error) => {
24        this.dispatchEvent(
25          new ShowToastEvent({
26            title: "Error updating replicated dataset",
27            message: error.body.message,
28            variant: "error",
29          }),
30        );
31      });
32  }
33}

This button calls the updateReplicatedDataset() method.

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