Aims to replicate and further extend the functionality of the SF native Path component. Some standout features:
- Syncs Key Fields and Guidance for Success from native SF Path Settings using the Metadata API
- Dynamically resolves infinite levels of nested dependent picklist fields using LDS
- Can define additional dependent fields for X picklist value using
PathAssistantStep__c
records - Can define a flow to launch when a user attempts to change to X pickist value using
PathAssistantStep__c
records, allowing for pre-commit validation
- After installing, schedule the
ScheduleQueueableSyncPathAssistants
job (I use every hour, but you could do whatever makes sense for your Org -- post install script coming for this eventually) - Run the
QueueableSyncPathAssistants
job once manually (or wait for your scheduled job to run) to sync all existing Path Settings to thePathAssitant__c
andPathAssistantStep__c
objects (anon apex snippet:System.enqueueJob(new QueueableSyncPathAssistants())
) - Assign the included
Enhanced Path Admin
andEnhanced Path User
permission sets out to relevant users - Create or update any
PathAssistant__c
andPathAssistantStep__c
records to configure any additional functionality for desired object + record type + picklist field cominbations. Additonal functionality includes: requiring dependent fields other than picklists or running a flow
PathAssistant__c
records have an external id field which is used for querying and upserting, the expected format is: ObjectAPIName_FieldAPIName_RecordTypeName
(so for example, Lead_Status___MASTER__
)
PathAssistantStep__c
records also have an external id field, the expected format concatenates the picklist value to the parent PathAssistant__c
's external id: ObjectAPIName_FieldAPIName_RecordTypeName_PicklistValue
(so for example, Lead_Status___MASTER__Converted - Business
)
- LWC always passes the same inputs to flow, these cannot be customized. They are 5 text variables and the expected names are:
newValue
,oldValue
,fieldApiName
,objectApiName
, andrecordId
- The toast that is sent when a flow finishes can be controlled and customized using a boolean flow output variable named
enhancedPathOverride
and setting it's value to true. To customize the toast title, message, and variant use flow text output variables namedtoastTitle
,toastMessage
, andtoastVariant
(see lightning-toast specs for list of variants)
**NOTE: There's a gotcha when using a combination of fault paths, subflows, and flow output variables. Make sure you set your output variables before the last screen the user sees if you're passing to subflows (especially if in a fault path), otherwise your output variables may not have the proper values passed back to the LWC.
I have a "router" flow for each object where I use the Enhanced Path component. I then configure my PathAssistantStep__c
records to have each picklist value where I want to perform some pre-commit validation using flow launch into this router flow.
In that router flow I then get the full record based on the recordId
passed in, then make decisions based on things like Record Type
, newValue
, and oldValue
to determine what subflow a user should be passed to when attempting to update X field on Y object to Z value. I'll then typically pass the full record around to the subflows to prevent further queries. At the end of the router flow and/or subflow I include an update node to set the picklist value to the newValue
as the LWC will not update the picklist after passing off to a flow.