0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Enhanced Transaction Security

0
Last updated at Posted at 2025-09-23

Create Transaction Security Policies

何もしないで検証ボタンをクリックしてみる

ReportEventイベントタイプに「大きなレポートのダウンロードを防止」というトランザクションセキュリティポリシーが見つかりません。スペースを含むポリシー名全体を入力し、ReportEventイベントが選択されていることを確認してください。

We can't find a Transaction Security policy named 'Prevent Large Report Download' for the ReportEvent event type. Make sure you’ve entered the full policy name, including spaces, and selected the ReportEvent event.

image.png

Use Apex in Transaction Security Policies

何もしないで検証ボタンをクリックしてみる

We can't find a transaction security policy named 'Block Large Data Export' for the ReportEvent event type. Make sure that you entered the full policy name, including spaces, and chose the ReportEvent event.

ReportEventイベントタイプに「Block Large Data Export」というトランザクションセキュリティポリシーが見つかりません。スペースを含むポリシー名全体を入力し、ReportEventイベントを選択してください

We can’t find the expected code in the BlockLargeDataExportEventCondition Apex class. Make sure that the global class name is 'BlockLargeDataExportEventCondition', and that you modified the 'evaluate(ReportEvent reportEvent)' method.

BlockLargeDataExportEventCondition Apexクラスに期待されるコードが見つかりません。グローバルクラス名が「BlockLargeDataExportEventCondition」であること、および「evaluate(ReportEvent reportEvent)」メソッドが変更されていることを確認してください。

global class BlockLargeDataExportEventCondition implements TxnSecurity.EventCondition {
    public boolean evaluate(SObject event) {
        switch on event{
            when ReportEvent reportEvent {
                return evaluate(reportEvent);
            }
            when null {
                // Don't take policy action when event is null
                return false;
            }
            when else{
                // Don't take policy action when event is not handled
                return false;
            }
        }
    }
    /**
     * Handle evaluating ReportEvent
     */
    private boolean evaluate(ReportEvent reportEvent){
        Profile profile = [SELECT Name FROM Profile WHERE Id IN
                            (SELECT profileId FROM User WHERE Id = :reportEvent.UserId)];
        // Take policy action only if the user profile is not 'Data Steward' and
        // RowsProcessed greater than 10.
        if (!profile.Name.contains('System Administrator')
            && reportEvent.RowsProcessed > 100) {
            return true;
        }
        return false;
    }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?