Process Builder

Documentation

https://help.salesforce.com/servlet/servlet.FileDownload?file=015300000035wMDAAY

Just go to Rakesh Gupta's website

 I can not explain Process Builder or Flows well enough. Just go to https://rakeshistom.wordpress.com/learning-process-builder/ to see all about it.

 

Overall Issues

  • Can't do one overall Criteria - eg IF this is a particular type of Campaign, then all the other criteria relate to this. 
    • You have to add that Criteria to each node of the process. 

UI

  • It takes the whole screen up - you can't quickly get back to other areas of setup. Open it in a new tab. 
  • You can't open multiple processes in a new tab from the main process builder screen - this is because the click event on the process builder heading is javascript code, and not a hyperlink. This is annoying. But get used to it, the whole of the new Lightning Experience is this way. (Well, apparently they are fixing this with the main Lightning Experience, but I have not heard for sure about Process Builder). 
  • You can't hyperlink to an individual process. This is completely shit for documentation. I have a document that outlines every single email that goes out and what triggers it. I can not specifically link to the process that triggers these emails in my documentation. NOT GOOD ENOUGH!. (I found one poorly worded idea in Success after much searching. This needs more points https://success.salesforce.com/ideaView?id=08730000000DmI7AAK)

Good Things

  • Create a Chatter Post
  • Create a Record
  • Automate Publisher Actions
  • Automate Flows
  • Update Records
    • Related Records - up the chain
    • Related Records - update multiple records below the current record.
    • Related Records - update multiple records below the current record based on a criteria. 
  • Coming in Winter '17 - call a Process from a Process - this may stop the issue of having to have the same criteria in each node - but I have to play with it for real. 
  • Invocable Actions - you need to understand what they are and why you would use them. 
  • You can now have multiple "trues" 

Things to Know

Processes are just Flows behind the scenes - see Process Builder Behind the Scenes for how you can tell. 

Reuse, Re-do, Re-order

  • You can't change the object that the Process runs from after you create the process. But workflow rules are like that too.  
  • You can't add new criteria in the middle of a process. You can now. Create it at the bottom and re-order it. 
  • You can't reorder criteria in the process. You can now. 
  • Why oh why can't you just go to the flow that is created by the process, modify that, and have it still open in Process Builder if it validates as a flow that works in Process Builder. 
  • The Name and description don't copy over. They do now! 
  • You can use only email alerts that are associated with the same object that the process is associated with. The record that started the process is used as the starting point for any merge fields that are used in the email alert. Similar to workflows. 

Activating

  • You can't activate a process unless it has at least one action on EVERY node. 
  • You can NOT activate a process if there are more than 50 Active workflow rules on that object already. Note: you can keep creating workflows if there are more than 50 workflows, but you will get stopped if you try to deploy a workflow from Sandbox, or activate a process. (See https://help.salesforce.com/apex/HTViewSolution?id=000181391&language=en_US). 

Issues

Lots of known issues https://success.salesforce.com/issues_index?tag=Process%20Builder

Building a Process

It is really hard to see exactly what the criteria are, and you have to click into the diamond to see it - BEWARE! mistakes are going to be made. 

I had to really shorten the Criteria Name so it displays in the diamond in a readable fashion. 
The 3 fields are actually filters on the Campaign - not that you can tell that.

I suggest you use Formulas instead - it is at least somewhat readable. 

Criteria

  • You can't set up one Criteria Node at the top of the process to be the general criteria that all nodes follow below. Eg, I wanted to set the top node to be - only do all of the things below, IF the Campaign is Active, and the start date is > today. But because I did not want to do any actions on that node, I could not activate the process. 
  • So, I have to put those criteria of Campaign = Active and Start Date > Today into each and every node - eg I want a Node that runs on Campaign Member Status = Enrolled, and another than runs on CM Status = Completed. 
  • BUT that only works IF the second criteria is different from the first Criteria. See my example below. 

 

Example

I want to enter values on the Contract that are stored on the Account. Default values from the account.

One is the Primary Contact for that Account that the Contract is for - so that's a lookup value. Lookup values can now be set by Process Builder - Yay! So it should be easy, right? Wrong.

The other defaults are picklist values - eg Contract Type and Contract Process

I only want the defaults to be updated IF the Contract is not Activated yet, and IF the Account is changed. I don't want to override any values inadvertently that may have been changed from the default. It is not likely that the Account gets changed on a Contract, but you have to allow for this.

So, my first criteria node (in pseudocode) is

  • IF(AND(ISCHANGED(Account)) ,
  • NOT(ISBLANK(Account)),
  • Status <> "Activated')

Then my Immediate actions on that criteria are Update Record, set:

  • Contract Type from Account.Contract Type
  • Contract Process from Account.Contract Process.

Now, I SHOULD be able to put in a third update here - update Primary Contact from Account.Primary Contact BUT we run into this issue. https://help.salesforce.com/apex/HTViewSolution?id=000212174&language=en_US - the Process Builder fails IF the Primary Contact on Account is blank.

So, you would think, well, I will just add another criteria to my process to keep it all in the same process. Wrong. Yep, I did this - this is why I'm writing this example.

Second criteria node

  • IF(AND(ISCHANGED(Account)) ,
  • NOT(ISBLANK(Account)),
  • Status <> "Activated')
  • NOT(ISBLANK(Account.Primary Contact)).

Now, let's think about this - we still don't want to set the primary contact on the Contract unless ALL those criteria are still true. HOWEVER, the process will NEVER get there because Process Builder is very dumb - it only handles TRUE/FALSE. After the first criteria node is executed it will ONLY execute the second criteria node IF the criteria in the first node is FALSE. This has changed now, but I don't know how it would change this issue.

No. I want to execute the process again (recursion) AND with the same criteria - just the one additional criteria.

This help document comes into play https://help.salesforce.com/apex/HTViewHelpDoc?id=process_advanced_considerations.htm&language=en_US but I am not 100% sure I'm reading it right. "ISCHANGED always evaluates to false when a record is first created". Yes, I get that. I am also not changing the account in this (or any other) process, so I can be confident that ISCHANGED is correct for the first node, but I don't know whether the recursion on the process would mean that ISCHANGED will be true or false on the second node. But it doesn't matter because under no circumstances will anything get to the second node because I only want to do any of this stuff when ISCHANGED is true.

So, my options are - create 2 processes both with the same criteria - Nope. Hard to maintain (and actually I want three or 4 lookup fields updated). So it's off to create a Flow for me!. Flows are going to contain all the logic in one place and be much easier to see the logic and build.

 

Updates

Fields

Using the fields selector has a few issues

  • Can't search on the fields
  • You have to scroll down to see the whole fields list
  • Clicking on the name of a field with a related list just selects the field - you have to click on the arrow. 

Emails

  • NOTE: You are NOT searching for email templates, you are searching for email alerts already created in the Workflows area. 
  • Email search only searches on the API name of the email alert.
  • Can't send emails from org wide addresses - now you would probably want to do this for about 99% of your emails https://success.salesforce.com/issues_view?id=a1p30000000T5cTAAS. (However, I was able to send an email like this. Weird). 

Chatter

 

Useless for Campaign Member

 Want to send an email from Campaign Member and then update Chatter to say that it has been sent? Well you are out of luck.

Campaign Member is one of those objects that is not a full Salesforce object, so it does NOT have a chatter feed.

You can't post to the feed of a related record, so therefore you can't put a post on the Contact (or Lead) instead.

No chatter posts for you!

 

Formulas

  • It seems like you have to write formulas in a programming way, not the regular formula way. Eg:
    • I could not use AND(true,true,true), I had to use true && true && true
    • I had to use field != "" rather than NOT(ISBLANK(field))
  • OMG, can't use some major formulas in Process Builder. 

    "If a formula in a process uses any of the following functions, the formula will return null.
    • IMAGE
    • INCLUDES
    • ISNEW
    • ISPICKVAL"

  • Formulas can only be 3000 characters, which is way less than even regular formulas, and usually the trick is to use Workflows to deal with larger formulas - back to workflows for this one. 

  • You can't check Syntax on the formula - you have to save it and go back into each time. 
  • I would suggest you create all your criteria in a formula field on your object as a checkbox field, and then just use that one field as the criteria within the node. 

Auditing

Articles

As you may notice, I'm not a fan of process builder - YET! and I've made a comment on the button click admin post mentioned above.