Activity Forums Salesforce® Discussions When should Apex be used over Workflow rules or Process Builder?

  • Prachi

    Member
    August 27, 2018 at 12:31 pm

    Hi Avnish,

    There are various reasons why you should use Apex over declarative automation options:

    -Workflow rules and Process Builder operations sometimes have feature limitations that can be overcome with Apex. For example, pulling information from an external system.
    -When dealing with certain or large sets of data, Apex can be more efficient than declarative options due to less limitations.

    Thanks.

  • shariq

    Member
    September 16, 2018 at 9:57 pm

    Hi,

    You can achieve everything  done by workflow and process builder with apex.

    Advantages of Apex -

    Apex

    Finally, there’s always Apex to help you achieve “everything else” — whatever business requirements you have that can’t be accomplished through declarative configuration. If you have access to a developer, with Apex the sky is the limit. With Apex you could do the following:

    – Delete records
    – Update unrelated records
    – Share records with more complex criteria than Sharing Rules permits
    – Add/remove users in Chatter Groups and Public Groups
    – Create email templates that pulls info from multiple records and Objects (combined with Visualforce)
    – And more

    Apex is powerful tool, but do your best to minimize its use. Don’t be afraid to employ it, but makes sure you think it through thoroughly to determine if there is a way you can accomplish what you need declaratively. Using Apex means that you’ll need to write test coverage and the more Apex you have, the longer it will take deployments from Sandboxes because the changes need to be validated against all of the code.

    By knowing the tools available, what they can do (and their limitations), and when is best to use each, you’re in a position to give your users the best experience possible while also creating an environment for your organization to have the best data possible.

    Hope it helps.

    • This reply was modified 6 years, 3 months ago by  shariq.
  • Parul

    Member
    September 17, 2018 at 2:49 am

    Because Each workflow rule applies to a single object, such as leads, accounts, or opportunities. For the maximum number of workflow rules allowed on an object, see Salesforce Editions and Limits.
    Workflow rules and Process Builder operations sometimes have feature limitations that can be overcome with Apex. For example, pulling information from an external system. You can automate your bussiness by using these tools easily.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos