You need to sign in to do that
Don't have an account?
trigger to prevent tasks being added to closed cases
Requirement Description
Requirement 1
Add business logic to Prevent a user from adding any other Task Record Types to a case with the status of Closed.
Add an error message to trigger on save of the task, if the user has added a Task where the WhatId relates to a case with a status of 'Closed'. The message to read 'Tasks cannot be added to Closed cases.'
Requirement 2
Add business logic to stop a user from adding an Event to a case with the status of Closed.
Add an error message to trigger on save of the event, if the user has added an Event where the WhatId relates to the case with a status of 'Closed'. The message to read 'Events cannot be added to Closed cases.'
I can't add it as a validation rule because WhatId is polymorphic.
Can anyone suggest the best approach.
--
Naveen K N
Naveen
Can you give me a head start with the trigger code?
Thanks
Barry
You can use the below triggers:
Task Trigger:
Event Trigger:
Thanks,
Maharajan.C