Workflow Rules in Salesforce vs Process Builder in Salesforce

Workflow Rules in Salesforce vs Process Builder in Salesforce

Today, Salesforce is the world’s leading Customer relationship management solution provider that helps grow businesses efficiently. Salesforce users leverage the core capabilities and enriched functionalities of Salesforce, from sending reminders to follow up with customers to creating sales projections and reporting accurately for top-level management.

Fortunately, Salesforce enables to create workflows and program tasks to automate business processes. Workflow rules and program tasks can be created with simple drop-down menus and flow charts. You can create a number of rule-based on certain criteria you set like sending an email, task creation, or field updation. These fantastic automation features within Salesforce help eliminate manual entry of data and save valuable time and efforts of sales representatives. 

In this blog post, we will discuss the Workflow rules and Process Builder and the steps that are followed to create a Process Builder in Salesforce.

What are Salesforce Workflow Rules?

Workflow rules are the orders created by a Salesforce user to perform automated actions when certain conditions or series of conditions are met. These tasks can happen suddenly or can be scheduled at a particular time based on a trigger.

Various actions that are performed by Salesforce Workflow:

1. Field Updation – Displays new data after altering a field when certain conditions are met.

2. Sending email – Salesforce users can generate preset emails by including plain text and HTML. These emails can be automatically sent when certain conditions have taken place in Salesforce. You can use mail merge for displaying the recipient’s first name, company, and other personal information.

3. Assigning Task – Once predefined conditions have taken place, you can set a new task for a particular user.

4. Sending a message to a different system

Sending an outgoing XML message to a specific URL outside the Salesforce ecosystem.

Salesforce Workflow has two components for salespeople to get the information about the quantity, type, and results that can be expected based on a certain scenario.

  • Criteria –  These are the “if” part of the procedure that is associated with the rule and must be true in order to perform the action with the linked expression.
  • Actions – These are “then” part. It consists of actions that take place when conditions are met.

What is Salesforce Process Builder?

Salesforce Process Builder is a powerful yet automated tool for Salesforce admin that allows them to:

  • Easily create processes through a convenient layout with point-and-click functionality.
  • Create the whole process in one place rather than using various workflow rules.
  • Create processes by interacting with different teams in your business.
  • Automate simple tasks without using Apex code.
  • Post on chatter to share information with any user.
  • Launch or trigger the flow from your process to automate multiple processes.

Difference between Workflow Rules in Salesforce and Process Builder in Salesforce

With Process Builder, you perform a lot more actions than Workflow Rules such as :

  • Create a record, 
  • Update any related record(Master-Detail – Lookup)
  • Using a quick action to create a record, update a record, or log a call
  • Launch a flow
  • Send an email
  • Publish to chatter
  • Send for approval
  • Call Apex methods

But the process builder does not support outgoing messages.

However, the Workflow can only perform 4 actions:

  • Create Task
  • Update fields (Same Object or Master Object in Master-Detail Relationship)
  • Email notification
  • Outbound Message

Scenario 1 – If there is any change into Contact Name then you need to update the Latest Contact custom field of Associated Account with the latest Changes into the account name.

In this scenario, the Process Builder is perfect because when using workflow we cannot update related records other than master-detail.

Scenario 2 – Update Latest Opportunity custom field of Account Object with the opportunity name that was recently closed.

Workflow is the right and innovative automation tool for the scenario described above, because the relationship between Account and Opportunity is Master-Details and using workflow rule we can update the master record and the same record.

Scenario 3 – Update all related cases and Contacts with the same phone of account whenever the account phone changed.

Process Builder is the perfect tool here because we need to update all contacts and cases. There may be more than one, and the Process builder allows you to do the same thing.

Steps to Create Process Builder in Salesforce

Setup–> Build–> Create–> Workflow and approvals–> Process builder

Step 1: Click on New to create a new process builder. A popup box appears where you need to fill name, description, and choose when to start the process from the following options

  •  A record changes
  •  A platform event occurs
  •  It’s invoked by another process

Then, click Save.

Now the screen will show the flowchart of what a Process Builder in Salesforce looks like.

Step 2: To begin the process, click on the Add Object. A screen appears on the right-hand side where you have to select the object name and the option to start the process and then click on save.

In an advanced option below, select yes if you want to enable the process to evaluate a record many times in a single transaction.

Step 3: Now, select criteria to evaluate the process. Click on Add Criteria, enter the name of criteria, and choose one of the below options for executing actions.

  • Conditions are met
  • Formula evaluates to true
  • No criteria—just execute the actions

Step 4: Click on the add row to add multiple conditions.

Set the condition and select the field and select one of the conditions among:

  • All of the conditions are met (AND)
  • Any of the conditions are met (OR)
  • Customize the logic

If required, we can schedule the action by setting a schedule button that has time and date to select. To Stop the flow click on stop. We can add more flows one after another or click on the activate button to assign data in the correct format and check validation rules. Process builder can perform more actions than Workflows in Salesforce.


Process Builder or Visual representation based Workflow Rules allow users to create customized processes and personalized user experiences. Both tools provide a large selection of actions they can perform based on criteria defined by the user. Available actions can be extended by packages installed in the org. This provides another way in which you can use the features for building customized scenarios. 

Salesforce Trailhead for Developers

Salesforce Trailhead for Developers

What is Trailhead?

Trailhead is an interactive learning methodology through the essential building blocks of the Salesforce1 Platform. It is better than ever, simpler approach to learning Salesforce. With this system, you can test your knowledge of the platform while gaining points and badges to celebrate your accomplishments. Trailhead gives developers and administrators a guided, learning path through the key components of Salesforce, utilizing an arrangement of intuitive, online instructional exercises.

Who can use Trailhead?

The introductory content for Trailhead was targeted towards beginners and intermediate developers. Since its launch, has covered more advanced subjects; thereby making Trailhead a helpful asset for developers and administrators at all levels of experience. The long haul objective of the Trailhead venture is to change how clients learn how to utilize Salesforce, by drastically rearranging and reclassifying the learning experience by making it simpler.

Why Trailhead stands out?

Some key features of Trailhead are:

Well, Planned Content – Trailhead content is composed of units, modules, and trails to help guide you through all that you need to know about the Salesforce1 Platform.

unit takes you through several learning objectives for an element or tool of the Salesforce1 Platform in order to reinforce the learning objectives by means of challenges.

module is a progression of units for a specific branch of knowledge. Once you’ve finished all the units in a module, you will acquire a badge to be displayed on your Salesforce Developers profile. There are presently 30 modules on trailhead with some recent additions like Accounts & Contacts, CRM basics, Event Monitoring, Leads & Opportunities etc.

trail is a progression of Modules, composed in a guided learning path to help you face different parts of the Salesforce1 Platform. –This hierarchical arrangement of content in three levels, thus: trails, modules, and units, and presented in a particular grouping order, assists clients have a predefined learning path to take after, and they don’t need to invest energy choosing what to read and in what order.

  • Self-paced, online learning – you can realize what you need when you require it, by picking up a suitable trail. Trailhead applies the model of intelligent learning models made popular by sites, namely Code School, Codecademy, Udacity, Coursera, and Khan Academy, to the objective of learning Salesforce.
  • Modular and engaging, content – every instructional exercise comprises of short units, which can be read in 10-15 minutes each. The content is intended to be basic, independent, and specifically helpful, to augment the value of the learning experience.
  • Interactive evaluations – toward the end of every unit, you can take a test to check what you just learned, either by answering multiple-choice questions or performing particular tasks in a DE org. On finishing a test, you can click a button and get instant feedback on whether you got it right.
  • Gamification – points, and badges are granted when you finish fruitfully the units and modules, respectively. The points and badges are shown on your profile, so you can

These elements combine to make Trailhead a refreshing, new way to deal with learning, providing a more straightforward, less demanding, and all the more captivating choice to begin with Salesforce. Previously, it was troublesome for new clients to find out about particular item features despite the fact that a large amount of detailed and accurate documentation is available, it’s not generally clear what to read and in which order. The incorporation of content and assessment is another key factor in Trailhead’s quality as a learning device and separates it from alternate types of documentation and client assistance Salesforce provides.

How it compares to other resources?

Trailhead content is like the Doc team’s other deliverable like – online help, developer guides, and implementation guides, in the sense that they’re all expected to help clients figure out how to utilize Salesforce products and features. However, Trailhead gives more of a guided and curated learning background.

Every module is intended to be straightforward, particular, and independent. The objective is to give clients all the essential data needed to take in a feature—background, contextual, conceptual, and procedural—in one incorporated bundle.At the end of the day, every module clarifies what a feature is, why and when it’s helpful, and additionally how to use it, while being simple and concise. The docs most like Trailhead are exercise manuals, which give basic instructional exercises, acquainting clients to a particular area, through a progression of steps. However, workbooks can’t give intuitive evaluations. Additionally, the later steps in many workbooks require previous steps as prerequisites, so the client can finish a big undertaking, for example, constructing an application.

Trailhead units, then again (at any rate until further notice), are intended to be generally autonomous, so that despite the fact that they’re organized in a specific succession, you can pick and choose the content of interest without needing to experience all units in a module, or all modules in a trail. Collaboration between the Salesforce Developer Marketing and Doc teams, Trailhead was launched at Dreamforce 2014 and from that point forward, the site has been improved with new features and content regularly.In the course of last few months, the Trailhead team has been relentlessly enhancing the site: adding new features and expanding the list of topics covered.

In the most recent redesign, Salesforce likewise revamped the content into four new trails, conveniently distinguished by role and experience level.

 How much does Trailhead cost?

The cherry on the cake for you as a client is that all of the Trailhead content is available for free. You can view all learning content without even signing in, yet in the event that you need to keep tabs on your development, complete challenges, and earn points and badges, you will need to login to Trailhead. Signup here for a free Developer Edition if you don’t already have one.

Process Builder Vs Apex Triggers –  Choosing Between Automation Tools

Process Builder Vs Apex Triggers – Choosing Between Automation Tools

Process Builder Overview

Process Builder is a graphical representation of your process as you build it. It consists of

Criteria, Immediate and Scheduled Actions.

There are following things which can be done by process builder:

  • Create Records:In addition to updating a record, you can create a record and set the field values within the record.
  • Create Chatter Post:   Push a chatter update into Group or Feed.
  • Create an approval:Traditionally you needed a trigger to push a record into an approval process automatically. With Process builder, you can do this automatically based on criteria of the process.
  • Quickly consolidate Workflow:Quickly consolidate multiple workflow rules that in one process.
  • Call an Apex Class:You can now call an Apex class.

Trigger Overview

A trigger is the piece of code, that is executed Before or After a record is inserted or updated.

Usually, an APEX (code) based evaluation of criteria to set off a chain of events.These events execute the following types of operations

  • Insert
  • Update
  • Delete
  • Merge
  • Upsert
  • Undelete

In Apex Trigger you must have

  • Need to programming knowledge.
  • Need to design test classes to meet required test coverage.

But the main difference in process builder is you can not delete any record and can’t show any error. For these, you have to write Trigger code. For example:

Apex Limitations

  • Total number of records retrieved via SOQL queries                                       50,000
  • Total number of records retrieved by DML                                                        10,000
  • Total number of SOSL queries issued                                                                 100(Sync) | 200(Async)
  • Total number of SOSL queries issued                                                                 20
  • Total number of records retrieved by a single SOSL query                             2,000
  • Total number of DML statements issued                                                           150
  • Maximum number of characters for a trigger                                                   1 million

Process Builder Limitations

Editing: User can’t edit process once it has been activated.Therefore much like with flow, a new process needs to be created by cloning the initial process and making modifications to that cloned records.

Validation: Processes DO NOT  trigger Validation rule and can, therefore, invalidate data.

Deletion: The inactive process can’t be deleted for at least 12 hours after inactivation and do not appear in the Recycle Bin

Error Message: You can’t specify error messages when creating a process that doesn’t trigger as you can with flow or validation rules.

Formula help: When utilizing formula in criteria, there is no function help preview next to the syntax

Syntax: Pick-list fields are evaluated as text fields in process builder so that they won’t support any pick list formulas like ISCHANGED or ISNEW.

Apex Trigger Best Practices

  • Apex code must provide exception handling.
  • When query large data set use an SOQL FOR loop
  • Don’t use  SOSL and SOQL inside for loop.
  • Avoid Hard Coding IDs

Process Builder Best Practices

  • Check: To see if there are any workflows on the object doing the same things as the process. Also, verify no active Apex Trigger.
  • Avoid: Interviewing Apex, workflows, and processes together for the same process.
  • Document: Use the Description field to populate information such as when it was created by who and what the process does.Also, if processes work in conjunction with each other.
  • Test: And then test some more.Especially when you are first starting to use this please practice in the sandbox first.

There’s a lot of ability to impact users and data here if you do something wrong.

Now the question is Why Process Builder and how is it differ from trigger?

Process builder is fully customization. No code required here because we require lengthy logic and record to complete and fulfill the requirement or if we using process builder it will take less time to complete the requirement.

It has some benefits over the trigger:

Scenario I

Populate a lookup field on record update:

Traditionally required a trigger and It can be done easily with process builder.

The issue is Multi layer lookup logic- i.e. multiple / nested maps of related data required in the trigger.

          Process builder Trigger Traditionally been something that requires a Trigger. Process builder allows administrator can do this without the use of the code.
Scenario II

Set an Account Owner based on Record criteria

Process builder


Process builder can be used to assign ownership of records based on criteria in the object.
Scenario III

Post a chatter message based on record criteria

Process builder


Process builder can be used to post to chatter based on record criteria.
Scenario IV

Submit a Quote for Approval when Opportunity Stage= Proposal

Process builder Trigger Requires 2 Processes one to Update the Quote based on the opportunity stage and another to submit the quote for the approval when the criteria on the quote had been met.
Scenario V

Launch a Flow via record criteria vs a button or link.

Process builder


Process builder can be used to set record criteria and then launch a trigger ready flow.
Scenario VI

Clone an opportunity and change the field values

Process builder


Although Process builder can create a new record it can’t reference any of the values from the cloned opportunity without the use of a flow to capture the opportunity values.

Let’s have a look on given Process builder example :

Allow Contact to copy Current User Address in Contact Address and Account Billing Address only when any address field(Street, Country, state )is blank/NULL.

Step 1:

Make your Process-builder on Contact Object. Provide the criteria as Contact.Mailing Street (IS NULL = FALSE) and likewise for every address fields of Contact and Opportunity.

Step 2:

In “Immediate Action” give reference of Mailing Country to that of Contact.Owner.Country and Activate your Process as:

 Step 3:

Now test this process builder in your org by leaving any address field blank in your org.

Step 4:

After leaving Contact address blank here is the address which got autofilled same as contact’s owner address. Similarly you can test this for your Contact’s Account.

This is the reason for using Process builder rather than using Apex. But  in some scenarios you’ll have to write trigger code where process builder can’t be.

For example:

Create a checkbox field “SAME COUNTRY AS USER & COMPANY”. Throw error when a Contact is getting inserted in Salesforce having Country same as User country and Company country.

Above example can’t be done via Process builder since this do not allow you to throw error while inserting Contact.
Create  Checkbox field named “SAME COUNTRY AS USER & COMPANY” on Contact.

public class SameUserAndCompanyCountryContact {

public static void sameCountry(List<Contact> conList){

   User user = new User();

   user = [SELECT Id , Country , CompanyName from User where Id =:UserInfo.getUserId()];


Organization orgDetails = [ SELECT Name , Country , Address from Organization where Name =: user.CompanyName];


for(Contact con : conList) {

  if(con.MailingCountry == user.Country && con.MailingCountry == orgDetails.Country){

   con.addError('Country of Company and User is same as country of Contact trying to insert');

     con.Same_Country_As_User_And_Company__c = True;




trigger ErrorOnSameCountry on Contact (before insert){
  List<Contact> conList =;
     if(conList!=null) {


Although the usage of process builder over apex trigger or vice versa is dependent on various other factors too, such as:

  • Complexity Of Codes.
  • Programmatic Logics.
  • Rapid Iteration In Process Builder Can Be Challenging.
  • Unit Test Considerations.