function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Apex Trigger prevent from repeating with Task

Hi My Friends,

I've a task Trigger, Its Service Class and another custom object related trigger ( That custom object will be a parent to Tasks)

When custom object field changes to 'Not Use' all the Tasks related to that custom object should be updated

I've a code like this:
CustomObjectTirgger-->TaskMainTrigger----> TaskserviceClass--> TaskServiceClassMethod
In this TaskServiceClassMethod i do check for a condition and i will update the customObject again. I am unable to handle this situation.. Has anyone experince with this situation?

You achieve this with help of Process builder without touching your code.
Create a process builder for your custom object and set your criteria if the field value set to 'Not Use' and in the action select the update records and choose the task object and set the value.

For more details on Process builder check this Trailhead module -