[SalesForce] better way to debug Salesforce automation (triggers/workflows/process builder) than Developer Console > Perspective Manager

I have some very simple automation in place for demoing Salesforce "Order of Execution". I have a field on called Version__c which increments by 1 in a trigger and a workflow. This is what happens:

  1. Before update trigger fires, Version__c increases to 1
  2. Workflow w/ field update fires, Version__c increases to 2
  3. Before update trigger fires again, Version__c increases to 3

I'm hoping to add more even more automation to this (process builder) and have our team easily track these types of changes when something unexpected in our org occurs.

The best visualization tool that I could come up with was in the Developer Console.

Debug > Perspective Manager > change to All (Predefined) > Click Save Order or Timeline tab

Are there any other tips/tricks that I could share to our non technical team members to help investigate these types of scenarios? I'll be honest, I even find Salesforce's developer console a bit verbose and intimidating at times…

Perspective Manager - All

****Update – I added a process builder (with Recursion unchecked), which increments the Version even more.****

My debug in the trigger appears hit 3 times in the logs. But the output is now 5? Now I'm even confused as to what is happening behind the scenes…

  1. Process Builder runs, updates the Version__c to 4?
  2. Trigger runs again, updates the Version__c to 5?

image2

Best Answer

After researching this extensively I didn't find any other good tools for determining the order of how these fire. What really is unfortunate is how unreliable this really is for the following reasons:

  • Process builder is not at all mentioned in any of the Execution tabs: 'Save Order', 'Timeline', 'Executed Units' etc. (only reference to process builder I could find was in the debug log itself: "14:10:18.0 (47496796)|WF_ACTION| Field Update: 2; Flow Trigger: 1;")
  • Before Triggers show up 6 times in the above screenshot, however only run 3 times (verified in debug logs)
  • Clicking into each of these triggers shows no details and displays the following message "No Batch, Schedule or DML actions"

finalscreenshot

For what it's worth here is the output and how many times each automation metadata type runs (in their respective order):

workflow and trigger (2): Trigger Ran; Workflow Ran; Trigger Ran;

workflow and process builder (2): Workflow Ran; Process Builder Ran;

trigger and process builder (3): Trigger Ran; Process Builder Ran; Trigger Ran;

all three (5): Trigger Ran; Workflow Ran; Trigger Ran; Process Builder Ran; Trigger Ran;