Flow Name: Restrict Delete Task¶
Last Updated: 2025-10-22 Source Code: Restrict_Delete_Task.flow-meta.xml
API Name: Restrict_Delete_Task Status: Active Type: Custom Trigger: Before Task record delete
Business Purpose¶
Implements access control to protect Task records from unauthorized deletion. Only users with System_Adminstrator_Custom permission can delete Tasks, preventing accidental data loss and maintaining audit compliance.
Process Flow¶
- Triggers before Task record deletion
- Checks if user has System_Adminstrator_Custom permission
- If permission exists, allows deletion to proceed
- 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 Tasks
- Applies to all Task 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
- Task object (standard Salesforce)
- Permission Set or Profile assignments with custom permission
Changes¶
PR-29900: Implemented deletion restrictions for Task records.
Pre-Go-Live Concerns¶
CRITICAL - Fix Before Go-Live¶
- Fix typo in error label: "Restrict To Detelete A Task" should be "Restrict To Delete A Task"
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 Task 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_Event for comprehensive activity protection Testing: Requires users with and without System_Adminstrator_Custom permission