Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
Hello,

When updating a contract I want to retrieve the list of contracts attached to this client and I check a field in at least one contract  and I update the account .

what is the best solution : process builder or trigger .. ?

Thanks for help.
3 answers
  1. Nov 12, 2020, 3:55 PM
    Hi Boudalia,

    Process builder drawbacks:

    >> Process Builders cannot handle before DML It executes after a record has been created or updated. Whereas Apex triggers can handle both before and after DML operations.

    >> Process Builder cannot handle delete and undelete DML. Whereas Apex triggers can handle all DML operations.

    >> An error reported in Process Builder is more generic which makes it difficult to find the origin of the error. With Apex triggers, exception handling can be made more specific.

    >> It is all or none in the case of Process Builder failure. But with Apex triggers partial success is possible.

    Although both can be used I would suggest checking if any of the above criteria would be met and in case if it meets then you can go for an apex trigger if not if it just this simple use case then you can go for a process builder.

    Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

    Thanks.
Loading
0/9000