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

PlatformStatusAlertEvent

アラートに関連付けられた標準プラットフォームイベントを表します。アラートは、ユーザの要求、または Einstein Next Best Action のサービスジョブの処理中に発生します。このオブジェクトは、API バージョン 45.0 以降で使用できます。

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

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

describeSObjects()

サポートされている登録者

Apex トリガ プロセス フロー ストリーミング API (CometD)
はい はい Yes Yes

ストリーミング API 登録チャネル

/event/PlatformStatusAlertEvent

項目

項目 詳細
ApiErrorCode
型
string
プロパティ
Nillable
説明
API エラーコード。
ComponentName
型
string
プロパティ
Nillable
説明
アラートが発生したコンポーネントの名���。
EventDate
型
datetime
プロパティ
Nillable
説明
イベントが発生した日時。例: 2018-12-18 21:59:48
EventIdentifier
型
string
プロパティ
Nillable
説明
イベントの一意の識別子。この項目は、将来の使用のために予約されおり、API バージョン 45.0 では常に null です。
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 投稿を作成したときに起動されるトリガの例です。

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

例

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

Alert occured 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