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.
RealtimeAlertEvent
Supported Calls
describeSObjects()
Supported Subscribers
| Subscriber | Supported? |
|---|---|
| Apex Triggers | ![]() |
| Flows | ![]() |
| Processes | ![]() |
| Pub/Sub API | ![]() |
| Streaming API (CometD) | ![]() |
Subscription Channel
/event/RealtimeAlertEvent
Special Access Rules
Accessing this object requires Service Cloud Voice with Amazon Connect enabled.
Event Delivery Allocation Enforced
Yes
Fields
| Field | Details |
|---|---|
| Description |
|
| EventDateTime |
|
| Name |
|
| Payload |
|
| Severity |
|
| Source |
|
Usage
1trigger RealtimeAlertEventTrigger on RealtimeAlertEvent (after insert) {
2 Id profileId = [select Id from User where User.Profile.Name = 'System Administrator' limit 1].Id;
3 for(RealtimeAlertEvent e : trigger.new) {
4 Feeditem Post = New Feeditem();
5 Post.ParentId= profileId;
6 Post.Body = 'Alert occurred in the service: ' + e.Source + '\n' +
7 'Name: ' + e.Description + '\n' +
8 'Severity: ' + e.EventDateTime + '\n' +
9 'Payload: ' + e.Payload + '\n' +
10 'EventDate: ' + e.EventDateTime + '\n' +
11 'Description: ' + e.Name + '\n';
12 insert Post;
13 }
14}Example
The code example displays as a Chatter post that contains the following:
1Alert occurred in the service: aws cloudwatch alarm
2Name: alert description
3Severity: 2021-11-05 11:11:11
4Payload: payload
5EventDate: 2021-11-05 11:11:11
6Description: alert name