getRecordAlerts(parentId, whatId)
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.
Return Value
Example
To fetch alerts that have parentId
ConnectApi.RecordAlertCollectionRepresentation recordAlerts = ConnectApi.RecordAlert.getRecordAlerts(‘<parentId>’, null);
To fetch alerts that have whatId
ConnectApi.RecordAlertCollectionRepresentation recordAlerts = ConnectApi.RecordAlert.getRecordAlerts(null, ‘<whatId>’);
To fetch alerts that have parentId and whatId
ConnectApi.RecordAlertCollectionRepresentation recordAlerts = ConnectApi.RecordAlert.getRecordAlerts(‘<parentId>’, ‘<whatId>’);