login

Tip of the Week

Tip of the Week – Don’t pass over the Process Builder in Salesforce

Over the last few months, I’ve been putting off an update I wanted to make in my developer org which required updating all child records when a specific change was made on the parent – think changing Account Status to “Closed” and wanting all Cases to be closed. Normally, I’d be plotting out the logic, writing a trigger, test class, test scenarios, testing it out, reworking, and it would take hours of painstaking work.  And if they wanted to make any small changes, its back to the drawing board with more Apex, more testing, more rework, etc. But now that the Process Builder is generally available, I decided to take a different route.

Using the Process Builder, I created a new process called “Close Cases when Account is Closed” and added a description to quickly highlight the logic. I set the main object to the parent, or the Account. The logic was: every time the record was created or edited, if the Account Status was “Closed”, and only when this field was actively changed. Next, I added an immediate action to update records, selected Cases__r from the list of fields/objects available, selected the Status field, and chose the value of Closed. After I reviewed and confirmed the logic, I activated the Process and tested it. Worked like a dream, and took less than half the time a trigger would have taken to develop and test. And the best part is that if anything needs to be changed in this process going forward, it can be updated quickly with clicks, not code!

-Jared and the Salesforce Guys

, , , , , ,

No comments yet.

Leave a Reply