How to use Process Builder in salesforce
By: Yathansh Sharma On: November 10, 2017
Salesforce admins, consultants, and most of the time developers, must be familiar with workflows. These are automated tasks which fire according to specified conditions and does some work that we set them for. However there is only so much that we can do with workflows and the functionality is very limited in them. We cannot create a record from a workflow, or update some other existing record. To achieve this task, Salesforce has provided us with a new functionality, that is Process Builder. And this is what I will show you, how to use the process builder.
The sample problem
Let’s take a sample problem where I want to create a record in standard price book with unit price value 0 every time a product is created. This can also be done with the help of triggers, however we will take a different approach for this blog, where we don’t have to write a single line of code.
Using the process builder
To solve the above problem let’s head over to the process builder. Go to Setup|Create|Workflow & Approvals|Process Builder and open it. This will open up a screen like this.
Click on the New button and a dialog will open prompting you to enter a name, api name, description and the process start when. Let’s name the process as ABC process for now and move ahead. The api name will be auto populated and set the process starts when as ‘A record changes’. Description is optional in this screen.
Click on save and a new screen will open.Here you need to click on the tab right below start in the flow chart, and select the object as product in the drop down on the right panel. Also click on the option button to start the process only when a record is created, and then save it.
Next click on the add criteria condition box and set the criteria name as ‘Always Run’. Select the option no criteria and click on save.
Now click on add action in the true section of the condition box and select the action type as Create a record. Set the action name as ‘Create pb Entry’. The record type is needed to be set to Price book entry. For the value of the fields set the Pricebook Id as the standard pricebook if of your org. Set the type of product id as Field Reference and the List price as 0.
Now we will set the product id for which this pricebook entry will be created. Click on the Find a Field in the end column of product Id row.Then set product Id in the field of the popup that opened, and then click on choose.
Save the record and click on activate.
With this done now we will test if the process builder works as expected. For this purpose we will head over to the product tab and click on new. Name the product ABC product and save the product. As soon as you will save the product you’ll see that there is a standard pricebook entry for this product, with the unit price as 0.
That’s all about using Process builder in salesforce, for any further queries feel free to contact us at:
Or let us know your views about this in comments section below.