updateReplicatedFields

Updates the collection of fields for a CRM Analytics replicated dataset by ID. This method merges the target replicated dataset's fields with the collection provided. Each field requires the name attribute, and a fieldType attribute is also required if it's a new field. This method can't be used to delete existing fields, but they can be skipped, which removes the field from active replication.

updateReplicatedFields uses this CRM Analytics API resource.

  • id— (Required) The ID of the replicated dataset.
  • replicatedFields— (Required) The collection of fields to merge into the existing fields for the replicated dataset. Use a Replicated Field Collection Input resource.

There are several ways to use updateReplicatedFields. For example, you can display a list of replicated datasets and the fields for each replicated dataset.

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

All fields in the existing collection must be present in the PATCH request. For fields that aren’t updated, only the name is required.

This button calls the updateReplicatedFields() method.