When it comes to clicks vs code, there ain’t a field that can’t be automatically updated or record created. This week we share our thoughts about Salesforce automation, focusing on the standard features of Workflow Rules and the complex features of Apex.
Furthermore we aim to answer the classic question – when to use these powerful automation features?
Last weeks results
Before you move on you may be interested to see who was triumphant in the Marshmallow challenge? For the results and full video click here.
Apex and Workflow
Jenny: Ah yes. When to use Apex and when to use Workflow. As Admins we know that both provide powerful automation on the platform, however given a business scenario would you actually know when to use Apex or Workflow? Pssst! It’s ok to say no! Admins of course don’t have to learn Apex and then be able to apply it to business solutions, however knowing when a Workflow can’t do the job, but Apex can, is certainly going to prove beneficial.
As Admins you should know the capabilities of Workflow Rules e.g. Tasks, Email Alerts, Field Updates, Outbound Messages, that is standard ADM 101 stuff right there. However when it comes to Apex, some (not all) Admins dare not enter that side of the setup menu. And rightly so – Apex is bloomin’ powerful. The last thing developers want is an Admin with no Apex knowledge clicking around! Remember, just because you can do anything behind the scenes doesn’t mean you should. But don’t let that stop you from getting to know a bit about the feature; My tip? Take advantage of your development team and get them to share information or do a presentation about Apex and its automation capabilities. Or why not get your Trailblazing game on. Oh and if you are new to Workflows, there are some fab trails on that too!
Simon: There is a huge limit to the capability of Workflow rules, such as not being able to give Tasks dynamically generated Subjects or create / delete records – which means sometimes you may need to compromise on quite what you want to achieve with Workflow. With Apex – you can do almost anything with records. The difference in time-to-deploy though, even with the best developer could easily be 4 or 5 fold.
If you want a Workflow rule to update a check-box to “ticked” when a status field on a record is set to “Received”, that’s going to take you 5 minutes in Workflow, including trialling it in a Sandbox first.. To write a correctly bulkified trigger with +ive and -ive test cases and promote it via a change set, you are looking at engaging a developer resource for probably an hour.
Of course if you wanted to update a checkbox on a Child record when a status is set to “Receive” suddenly you are outside of the capability of Workflow completely.
Jenny: As Simon has mentioned above, there are limitations to Workflow rules. However, the platform has become very powerful when it comes to clicks with the likes of visual flow and process builder, which is something we will discuss in a later post. The thing to remember is that the beauty of Workflow is in its simplicity. You only have to click here to find some great Workflow rules to realise that!
Simon: So, the reality of the answer “which should I use” when both technologies have the ability is actually probably “use whichever you have the skillset to do correctly” .. or within businesses, this probably means can you get your hands on a developer. The worst thing about the plethora of tools available on the platform now are the projects that mix them all up, so in any single transaction you have fields being updated by Workflows, data being manipulated in Triggers, and child records being created in Processes and Flows, meaning when you need to debug or change your business processes, you have to look all over the architecture to find what did what. Keeping everything neatly in one place should be a genuine consideration for picking your technology.
As a final, personal, note: Remember that anything that affects business data, processes or customers should have automated functional testing – which in Salesforce, generally requires Apex code; meaning even if you do opt to use Workflow as a “quick” solution to a requirement, you are not excused from getting a developer to drum you up some tests.
This weeks challenge: Backgammon
Admins and Dev may be strategic when it comes to providing solutions to automation, but when faced with an old school game like Backgammon whose strategy is going to earn them the winning points?
See you next week!
Jenny and Simon