You need to sign in to do that
Don't have an account?
Apex Estrategia
Close task and close case
Hi !
I create a trigger to close my case when I close one specific task.
trigger FechaTask_FechaCase on Task (after update) { Task[] cse = Trigger.new; Set<ID> cseIds = new Set<ID>(); for (Task t:cse) if (t.status == 'Completed' && t.subject == 'Baixar PP') cseIds.add(t.whatid); for (Case c : [select id, motivo__c, status from case where id in :cseIds for update]) if (c.motivo__c == 'Solicitação de Pagamento'){ c.status = 'Closed'; update c; } }
And I got an error:
- Corpo: Validation Error: Value is required
- FechaTask_FechaCase: System.LimitException: Too many SOQL queries: 101
I don't know why this error appears just when I try to close the case.
If I update a regular field my trigger works.
All Answers
Thanks sfdcfox.
It's what I thought.
I have one trigger to close some tasks if I close the case.
I think they are in conflict.
Thanks again.
I will not use this trigger anymore. It's not as important.