The legacy Salesforce workflows were useful, and they still perform functions that cannot be accomplished by other means. However, I feel that they are cumbersome to create, name and maintain.
Process Builder, on the other hand, is awesome. Aside from some quirky limitations that are starting to be addressed, it can do some really cool stuff. Too bad my receiving object will probably go in the trash bin – but before it does, let me show you why the developer in me got carried away.
Recall that the purpose of the receiving form was to reduce data entry for multiple donations to a handful of keystrokes.
Vendors deliver grocery rescue items one or more times a week. Often all of the food goes to a single program, the market. In fact, in most cases a donor will give towards a certain program. If this is the case, why require the user to select the program every time?
The figure above describes the flow we want: if the user selects a program on the receiving form, that is the program that is associated with the donation. If a program is not selected, the default program is used.
In order for this to work, be sure to create a validation rule that prevents the user from leaving the program field blank if the account does not have a default program.
If a user enters data for at least one donation type, either the account default program must have a value or the value for the related program must be specified.
There are two steps to this process. When the receiving record is created and saved, the program must be filled in if it does not exist. Note that this process only runs if applicable. For example, if the user enters the number of pounds donated for a perishable item or an amount of money donated, then the workflow will fire. Otherwise, it is ignored.
The second step is creating the donations record. Both of these are immediate actions. Here is the first step:
Now that all of the fields in the receiving record are filled in we can proceed to the second step:
This creates a new donation record and populates it with the information gathered from the receiving record.
Process Builder is extremely powerful, and it allows the administrator to fulfill many requirements without writing any code.
Everything in Moderation
Don’t get carried away with the technology. Whether you are a professional consultant or someone who has taken a few Salesforce Trailhead courses, always look for the simplest visible (user interface) answer to any question. I use the term “visible” because all the cool “behind the scenes” stuff is useless unless it improves (and does not detract from) the user experience.
In our planning session today I brought up the fact that the receiving object was an overblown, over-engineered dismal failure. We agreed that a simple donations objects is all we needed.
Another Plus for Salesforce
Back in the 90’s the new software development craze was RAD (Rapid Application Development) tools. These were the predecessors to environments such as Salesforce. Easily configurable, drag-and-drop components allowed the developer to relatively quickly build an application. The concern over this approach is that developers would jump right into coding instead of taking time to design things the right way in the first place.
Another problem with RAD tools is that “rapid” was relative. Yes, it was faster than previous development methods, but it still was a lot of work. And no matter how much planning went into the application, nothing was certain until it was tested by the people who would be using the software.
Simply put, user testing is the best way to validate your design, and the faster you can get something operational, the faster you will get something into production.
That is precisely why I am happy to see the receiving object disappear. Thanks to Salesforce, it will take me under ten minutes to decouple it from the donations object, change the donation object to use record types, and delete both the receiving object and all its associated processes. In my RAD development days, it would have taken days, maybe even weeks to achieve the same thing.