anusha(salesforce developer)

Thursday, 2 February 2017

THE PROS & CONS of APEX,WORKFLOW RULES,VISUAL WORKFLOW,LIGHTNING PROCESS BUILDER


APEX
is really good at handling complicated logic and lots and lots of records. When you’re dealing thousands, hundred of thousands, millions of records – your looking at using APEX. You can use APEX for more simple use cases, but then that takes the flexibility away from the Admin. Most administrators do not know how to code in APEX. The major “con” for APEX is the requirement of needing an APEX developer. This also means there’s a time component. If you need a “quick change,” you’re depending on the developer’s schedule. The developer needs to update the code and test class. Then you’ll need to functionally test it and deploy. APEX is great for complicated and large processes, but there are often easier and more accessible methods for the smaller stuff.
WORKFLOW RULES
are fast, easy, and button-click friendly. The Workflow rule will “trigger” based on a set of criteria at which point the actions will either be immediate or based on a time-based schedule. Workflow rules can do a lot. They can update fields for the object it’s being “triggered” on and in certain circumstances update records for their parent record. Workflow rules can send out emails and create tasks. There’s also the rarely used Outbound message for integration.
One downside to the Workflow Rule is organization. Each set of criteria requires a new workflow rule. This means you’ll have many workflow rules for the same workflow process. For example, you want to have similar but different actions fire based on the stage of the Opportunity. This will require 1 Workflow rule per stage. The only way to organize this is by the naming convention of the rule – which can get messy.
A second downside to workflow rules are from the management perspective. You have no way of knowing what the actions are without “drilling” into each Workflow rule. That can be quickly annoying.
The final downside is the limitation. You are limited in what records you create and update, and you don’t have access to many of new features (chatter) available.
VISUAL WORKFLOW
is more complicated for most users to learn and use regularly. Unlike Workflow Rules, you have access to many other actions. You can create nearly any record and can update nearly any record. The two downsides to Visual Workflow are the difficulty it to learn the tool and it cannot be “fired” on it’s own.
LIGHTNING PROCESS BUILDER
is the new version of Workflow Rules. You can do a lot more different types of actions – including having a Flow from Visual Workflow get called. This gives you a lot of different powers. It’s built on top of Visual Workflow so you have almost all the same power of that tool. A Process can have multiple criteria diamonds – basically the equivalent of nesting multiple Workflow Rules together on one page. You can also see all the actions for each set of criteria that will be called.
One downside of the Process Builder is you currently only have access to the records and fields the running user has. Workflow rules would let you update an “invisible” field to the user. This was great for lots of data validation and controls. With Process Builder (and Visual Workflow) the field must be visible and editable by the user in order for the tool to update the field.
There are some other downsides with the current version. The tool isn’t truly “bulkified” so managing many many records will be problematic. There are also some limits on the number of “criteria diamonds” you can have and the number of active processes per object.

Differences between Process Builder and other tools in force.com

Salesforce offers various tools to automate business processes, for example, Flow, Workflow Rule, and Process Builder. So, it is required to understand the difference between these tools and when to use which. The following table describes the difference between these tools:
 
Workflow
Flow
Process Builder
Visual designer
Not available
Available
Available
Starts when
A record is created or edited
  • The user clicks on a custom button/link
  • A Process starts
  • Apex is called
  • Inline Visualforce page
  • The user accesses a custom tab
A record is created or edited
Supports time-based actions?
Yes
Yes
Supported, but only one scheduled-actions per criteria. This means that in the same Process..