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
Piyush NandrekarPiyush Nandrekar 

Should i call approval process from process builder or call approval process from apex using approval class ? I have tried it and done this both way . I need to what is difference , which is preferred and why

Should i call approval process from process builder or call approval process from apex using approval class ? I have tried it and done this both way . I need to what is difference , which is preferred and why
Best Answer chosen by Piyush Nandrekar
Meghna Vijay 7Meghna Vijay 7
Hi Piyush,
The short answer is that you should use a Trigger when you cannot do what you want to do with the declarative features of Salesforce. Salesforce best practice states that one should leverage the declarative features of Salesforce first (#8) (https://developer.salesforce.com/blogs/developer-relations/2015/01/apex-best-practices-15-apex-commandments.html).
Process Builder is improving with almost every release, and can be used with more and more complicated use cases. This link  (https://salesforce.stackexchange.com/questions/78774/is-process-builder-a-complete-alternate-for-the-triggers)provides very helpful scenarios where Process Builder would be preferable to Triggers.
For mor info , see this link:-
https://salesforce.stackexchange.com/questions/126970/trigger-vs-process-automation
Hope it helps.
Thanks

All Answers

Meghna Vijay 7Meghna Vijay 7
Hi Piyush,
The short answer is that you should use a Trigger when you cannot do what you want to do with the declarative features of Salesforce. Salesforce best practice states that one should leverage the declarative features of Salesforce first (#8) (https://developer.salesforce.com/blogs/developer-relations/2015/01/apex-best-practices-15-apex-commandments.html).
Process Builder is improving with almost every release, and can be used with more and more complicated use cases. This link  (https://salesforce.stackexchange.com/questions/78774/is-process-builder-a-complete-alternate-for-the-triggers)provides very helpful scenarios where Process Builder would be preferable to Triggers.
For mor info , see this link:-
https://salesforce.stackexchange.com/questions/126970/trigger-vs-process-automation
Hope it helps.
Thanks
This was selected as the best answer
GovindarajGovindaraj
Hi Piyush,

It's always good, if we can acheive our business usecases using configuration.

In your case, If you can call an approval process using process builder then go with that. Else, if you have complex usecases and can't achieve through configuration then go for Apex.

Thanks,
Govindaraj.S