Skip to content

Flow Name: Restrict Delete Event

Last Updated: 2025-10-22 Source Code: Restrict_Delete_Event.flow-meta.xml

API Name: Restrict_Delete_Event Status: Active Type: Custom Trigger: Before Event record delete

Business Purpose

Implements access control to protect Event records from unauthorized deletion. Only users with System_Adminstrator_Custom permission can delete Events, preventing accidental data loss and maintaining audit compliance.

Process Flow

  1. Triggers before Event record deletion
  2. Checks if user has System_Adminstrator_Custom permission
  3. If permission exists, allows deletion to proceed
  4. If permission missing, throws custom error blocking deletion
📊 Click to view Process Flow Diagram
flowchart TD
    Start([Start: Before Delete]) --> Check{Has System<br/>Admin Permission?}
    Check -->|Yes| Allow[Allow Deletion]
    Check -->|No| Error[Throw Error:<br/>No Permission]
    Allow --> End([End])
    Error --> End

    style Start fill:#e1f5ff
    style Check fill:#fff4e1
    style Allow fill:#e1ffe1
    style Error fill:#ffe1e1
    style End fill:#e1f5ff

Key Business Rules

  • Only users with System_Adminstrator_Custom permission can delete Events
  • Applies to all Event records without exception
  • Displays user-friendly error message: "You do not have permission to delete this record."
  • Permission check uses negative logic (NotEqualTo true)

Dependencies

  • Custom Permission: System_Adminstrator_Custom
  • Event object (standard Salesforce)
  • Permission Set or Profile assignments with custom permission

Changes

PR-29900: Implemented deletion restrictions for Event records.

Pre-Go-Live Concerns

CRITICAL - Fix Before Go-Live

  • Fix typo in error label: "Restrict To Detelete A Event" should be "Restrict To Delete An Event"

HIGH - Address Soon After Go-Live

  • Verify custom permission is properly configured and assigned
  • Test deletion restrictions with both admin and non-admin users

MEDIUM - Future Enhancement

  • Consider context-specific restrictions based on Event type or status
  • Add logging for attempted unauthorized deletions

LOW - Monitor

  • Track frequency of unauthorized deletion attempts
  • Monitor admin feedback on restriction appropriateness

Maintenance Notes

Complexity: Low - Simple permission check Review Schedule: Annual review or when permission structure changes Companion Flow: Works with Restrict_Delete_Task for comprehensive activity protection Testing: Requires users with and without System_Adminstrator_Custom permission