この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

PlatformStatusAlertEvent

ユーザー要求またはサービスジョブ実行の処理中に発生したアラートをサブスクライバーに通知します。このオブジェクトは API バージョン 45.0 以降で使用できます。

たとえば、ユーザーの要求の処理中に数式が評価されるとします。無効な数式の評価でエラーが発生すると、ユーザーの要求の処理中にプラットフォームイベントメッセージが生成されることがあります。

サポートされているコール

describeSObjects()

サポートされているサブスクライバー

サブスクライバー サポートされているかどうか。
Apex トリガー はい
フロー はい
プロセス はい
Pub/Sub API はい
ストリーミング API (CometD) はい

登録チャネル

/event/PlatformStatusAlertEvent

特別なアクセスルール

このオブジェクトにアクセスするには、「アプリケーションのカスタマイズ」、「すべてのデータの編集」、または「Next Best Action 戦略を管理」ユーザー権限が必要です。

イベント配信割り当ての適用

はい

項目

項目 詳細
ApiErrorCode
string
プロパティ
Nillable
説明
API エラーコード。
ComponentName
string
プロパティ
Nillable
説明
アラートが発生したコンポーネントの名前。
EventDate
datetime
プロパティ
Nillable
説明
イベントが発生した日時。例: 2018-12-18 21:59:48
EventIdentifier
string
プロパティ
Nillable
説明
イベントの一意の識別子。この項目は、将来の使用のために予約されおり、API バージョン 45.0 では常に null です。
EventUuid
string
プロパティ
Nillable
説明
プラットフォームイベントメッセージを識別するユニバーサル一意識別子 (UUID)。この項目は、API バージョン 52.0 以降で使用できます。
ExtendErrorCode
string
プロパティ
Nillable
説明
問題に関する詳細を示す拡張エラーコード。
RelatedEventIdentifier
string
プロパティ
Nillable
説明
関連イベントの EventIdentifier (uuid)。この項目は、将来の使用のために予約されおり、API バージョン 45.0 では常に null です。
ReplayId
string
プロパティ
Nillable
説明
システムによって生成された ID 値を表し、イベントストリーム内のイベントの位置を参照します。連続するイベントに対して再生 ID の値に連番が振られるという保証はありません。サブスクライバーは再生 ID の値を保存し、再登録時にその値を使用して、保持ウィンドウ内の欠落したイベントを取得できます。
RequestId
string
プロパティ
Nillable
説明
このイベントを起動したサービスジョブの一意の ID。これを使用してアラートをログ情報と相関することができます。
ServiceJobId
string
プロパティ
Nillable
説明
サービス固有のジョブ ID (存在する場合)。Next Best Action の場合、サービスジョブ ID は executionToken です。この項目を使用してアラートをログ情報と相関することができます。
ServiceName
string
プロパティ
Nillable
説明
アラートをトリガーしたサービスの名前。
StatusType
string
プロパティ
Nillable
説明
イベントの状況。
SubComponentName
string
プロパティ
Nillable
説明
アラートが発生したサブコンポーネントの名前。
Subject
string
プロパティ
Nillable
説明
アラートの簡単な説明。
UserId
reference
プロパティ
Nillable
説明
イベントの原因となったユーザーの ID。
Username
string
プロパティ
Nillable
説明
イベントの原因となったユーザーのユーザー名。

使用方法

次の例は、プラットフォーム状況アラートイベントを処理する方法を示しています。内部サービスのみがこのイベントを公開できます。これは、プラットフォームイベントメッセージが公開されたときに起動され、管理プロファイルでイベントの詳細を含む Chatter 投稿を作成する Apex トリガーの例です。

1trigger PlatformStatusAlertEventTrigger on PlatformStatusAlertEvent (after insert) {
2    List<Feeditem> posts = new List<Feeditem>();
3    Id profileId = [select Id from User where User.Profile.Name = 'System Administrator' limit 1].Id;
4    
5    for(PlatformStatusAlertEvent e : trigger.new) {        
6       Feeditem post = New Feeditem();
7       post.ParentId= profileId;
8       post.Body = 'Alert occured in the service: ' + e.ServiceName + '\n' +
9            'APIErrorCode: ' + e.APIErrorCode + '\n' +
10            'ComponentName: ' + e.ComponentName + '\n' +
11            'EventDate: ' + e.EventDate + '\n'+
12            'EventIdentifier: ' + e.EventIdentifier + '\n' +
13            'ExtendedErrorCode: '+ e.ExtendedErrorCode + '\n' +
14            'RelatedEventIdentifier: ' + e.RelatedEventIdentifier + '\n' +
15            'ReplayId: ' + e.ReplayId + '\n' +
16            'RequestId: ' + e.RequestId + '\n' +
17            'ServiceJobId: ' + e.ServiceJobId + '\n' +
18            'ServiceName: ' + e.ServiceName + '\n'+
19            'StatusType: ' + e.StatusType + '\n' +
20            'SubComponentName: ' + e.SubComponentName + '\n' +
21            'Subject: '+ e.Subject + '\n' +
22            'UserId: ' + e.UserId + '\n' +
23            'Username: ' + e.Username + '\n';
24       posts.add(post);
25    }
26    if (posts.size() > 0) {
27        insert(posts);
28    }
29}

このコード例は、最終的に次を含む Chatter 投稿として表示されます。

Alert occurred in the service: Next Best Action Strategy

APIErrorCode: INVALID_OPERATION

ComponentName: Strategy_for_error_event_demo

EventDate: 2018-12-18 21:59:48

EventIdentifier: null

ExtendedErrorCode: FORMULA_EXPRESSION_INVALID

RelatedEventIdentifier: null

ReplayId: 63

RequestId: TID:89715900005e40b69a

ServiceJobId: 1014fd4e-4a19-4910-be36-377a7f2f1b75

ServiceName: Next Best Action Strategy

StatusType: Error

SubComponentName: filter_node1

Subject: Something went wrong with filter element 'filter_node1': 'Unknown function ISBLANC.Check spelling.'

UserId: 005RM000001ZnzAYAS

Username: xxx@yyy.com