You need to sign in to do that
Don't have an account?
Linda 98
URGENT!! Update count on deleting records.Using delete context variable.
Hi i am having a requiremnt where i have to update custom fields which hold count of tasks on that Case.
Everything works fine but when i delete the task,i want the count to be updated/decreaded accordingly.
If i am having 8 open tasks and when i delete one task of it,i want the custom field to be updated with 7 .
please guide me.
Everything works fine but when i delete the task,i want the count to be updated/decreaded accordingly.
If i am having 8 open tasks and when i delete one task of it,i want the custom field to be updated with 7 .
please guide me.
1-> Get the id of Parent case for that task based on "Related To" Field of Task.(this will give you the case Id)
2-> Use the case id to query all the open tasks related to that case Id.(select count() task where status=open AND relatedto ='Case ID which we got in 1st step')
3-> set the count value which we received in 2nd as task count in that case record.
This logic will be aplicable for all the event insert ,update and delete and you would not need to worry about handeling them seperatly
Please check