Hello Everyone,
I’m working with
Salesforce Action Plans where tasks are created automatically from an Action Plan Template when a Case is created.
I have a requirement to auto-complete the first task (based on some condition like Subject contains 'AUTO') so that the next dependent task opens automatically
.
What I observed:
1. Before Insert Trigger
- I set Status = 'Completed' in a before insert trigger
- Task gets created as completed (IsClosed = true)
- ❌ Next task does NOT open
2. After Insert Trigger (Synchronous Update)
- I updated the task to Completed in after insert
- Status updated correctly
- ✅ Next task opens correctly
3. Queueable Apex (Async Update) in Before Insert Trigger
- When I moved the completion logic to a Queueable class
- Task is first created, then updated asynchronously
- ✅ Next task opens correctly
I would like to keep this in before insert only.
Please add your thoughts , solution.
답변 2개
but I am just marking first task as Completed in trigger. Ideally It should automatically detect that first task is completed and it should open second task.