Note: 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.

getRecordAlerts(parentId, whatId)

Retrieve a list of active record alerts.

API Version

54.0

Requires Chatter

No

Signature

public static ConnectApi.RecordAlertCollectionRepresentation getRecordAlerts(String parentId, String whatId)

Parameters

parentId
Type: String
The related parent record ID on which a record alert is created.
whatId
Type: String
The Salesforce object record ID on which a record alert is created.

Example

To fetch alerts that have parentId

1ConnectApi.RecordAlertCollectionRepresentation recordAlerts = ConnectApi.RecordAlert.getRecordAlerts(‘<parentId>’, null);

To fetch alerts that have whatId

1ConnectApi.RecordAlertCollectionRepresentation recordAlerts = ConnectApi.RecordAlert.getRecordAlerts(null, ‘<whatId>’);

To fetch alerts that have parentId and whatId

1ConnectApi.RecordAlertCollectionRepresentation recordAlerts = ConnectApi.RecordAlert.getRecordAlerts(‘<parentId>’, ‘<whatId>’);