Find Process Builder Name by Id

1 Mar

Deployment errors can be hard to track down when they give vague descriptions like when a Process Builder encounters an error. You end up with something like this.

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30121000000UF54. Flow error messages: An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Contact your administrator for help.: []

To figure out what ‘30121000000UF54’ is, the Id can be opened in the Flow designer. Enter the url for the flow designer with the Process Builder id, and the name of the process builder will appear at the top of the page.

// format

// example

Alert with Option Buttons in the Window Body – jQueryUI in a Salesforce Custom Button

5 Nov

Here is another example of using jQueryUI in a Salesforce custom button. I’m referencing Super Clone Pro pages that use different configurations for cloning in this example. This could easily be adapted for other pages or actions. Enjoy!


var $j = jQuery.noConflict(); 
$j(function() {
      var winHead = '' +
      var winBody = '';

        autoOpen: true, 
        modal: true,
        width: 500,
        buttons: { 
            "Cancel":  function() {$j(this).dialog("close");}

      $j( "#clone-op" ).button().on( "click", function() {
        window.location.href = '/apex/lcrm-scp__scpclone?rid={!Account.Id}&cfg=StandardClone';
      $j( "#copy-from-op1" ).button().on( "click", function() {
        window.location.href = '/apex/lcrm-scp__scpclone?rid={!Account.Id}&cfg=CloneOpt1';
      $j( "#copy-from-op2" ).button().on( "click", function() {
        window.location.href = '/apex/lcrm-scp__scpclone?rid={!Account.Id}&cfg=CloneOpt2';
      $j( "#copy-from-op3" ).button().on( "click", function() {
        window.location.href = '/apex/lcrm-scp__scpclone?rid={!Account.Id}&cfg=CloneOpt3';
      $j( "#copy-to-op1" ).button().on( "click", function() {
        window.location.href = '/apex/lcrm-scp__scpcopy?rid={!Account.Id}&cfg=CopyOpt1';
      $j( "#copy-to-op2" ).button().on( "click", function() {
        window.location.href = '/apex/lcrm-scp__scpcopy?rid={!Account.Id}&cfg=CopyOpt2';
      $j( "#copy-to-op3" ).button().on( "click", function() {
        window.location.href = '/apex/lcrm-scp__scpcopy?rid={!Account.Id}&cfg=CopyOpt3';


Alert with Three Options – jQueryUI in a Salesforce Custom Button

18 Aug

Recently, I was asked to create a custom button that would allow a user to choose between two SuperClone Configuration options. jQueryUI provides a nice modal dialog that solved the problem. The dialog showed two buttons for the configurations and a cancel button. Below is the sample code for what I put together. The actions for each button could be swapped out to load other any other pages or run javascript methods.

A few stackoverflow posts helped me put this together. Credit to:
jQueryUI Modal Dialog


var $g = jQuery.noConflict(); 
$g(function() {
        autoOpen: true, 
        modal: true, 
        buttons: { 
            "Config 1": function() {"superclone url here for config 1","_self");},
            "Config 2":  function() {"superclone url here for config 2","_self");},
            "Cancel":  function() {$g(this).dialog("close");}

Eclipse IDE Editor Configuration Preferences

12 Apr

Eclipse can be setup to display code in an infinite number of ways. The following settings are how I like to configure the Eclipse IDE.

  • Spaces instead of tabs
  • Show line numbers
  • Show whitespace characters
  • Show a print margin

These settings can be changed at: Window -> Preferences -> General -> Editors -> Text Editors

Eclipse Editor Configuration

Click the “configure visibility” link next to the show white space setting to add fine tuning. I always uncheck the the trailing carriage return and line feed boxes and increase the opaqueness.

Eclipse White Space Characters

Apex File Naming Standards

5 Apr

Consistent file naming helps keep Visualforce and Apex classes easy to recognize and find. I’ve seen many orgs with both the good and the bad. Below is a table with naming suggestions. Some of them are mine, but most came from a presentation that I found referenced in a Trailhead module. The presentation is by Vivek Chawla. I recommend looking it over because it covers a lot of good stuff. Thank you Vivek.

Apex and Visualforce Naming

  • UpperCamelCase
  • Avoid using underscores.
  • Use full names where possible. Be consistent.
  • Test class should be named for the class they cover, and the word “Test” should be appended to the end.
Functional Type Name Suffix Examples
Trigger Trigger AccountTrigger
Trigger Handler TriggerHandler AccountTriggerHandler
VF Controller Controller AccountCloneController
VF Controller Extension ControllerExt AccountCloneControllerExt
Service Class Services AccountServices
Utility Class Util AccountDupeCatcherUtil
Selector Class Selector AccountSelector
Model / Wrapper Class Varies… Accounts / AccountWrapper
Web Service (SOAP) Ws AccountToolsWs
Web Service (REST) Rest AccountToolsRest
Email Service EmlSvc AccountCreateEmlSvc
Asynchronous (Future) Async AccountIntegrationsAsync
Asynchronous (Batch) Batch AccountMigrationBatch
Scheduled Apex Job AccountCleanupJob
Queueable Apex Que AccountSyncingQue
Visualforce Page -none- AccountClone
Visualforce Component Cmp AccountCloneCmp
Lightning Components -TBD-
Lightning Pages -TBD-

Workflow Rule, Field Update, and Email Alert Naming

Workflow Rules and their actions can also get unruly without consistent naming. Force365 published some good suggestions. Below are the ones that I refer to most.

Workflow Rule
[Object]: [Criteria Description i.e. Condition]

Workflow Actions
Field Update –
Set [Field] to [Value]
Email Alert –
Send [Template short description]
Task –
[Task Subject]


SlideShare: Salesforce Development Best Practices by Vivek Chawla
Blog: Force365 – Salesforce Naming Conventions – Declarative