4

Background

I'm getting a dreaded flow error for one of our test methods that occurs fairly regularly, but not consistently. I've reviewed the debug logs thoroughly, but can't see any obvious way to address. Are there any special tips for debugging flow errors?

Test Code

SBQQ__QuoteLine__c sbql = new SBQQ__QuoteLine__c();
sbql.SBQQ__Quote__c = testQuoteId;
sbql.SBQQ__Product__c = testProductId;
sbql.SBQQ__Quantity__c = 1;
sbql.SBQQ__PricingMethod__c = 'List';
sbql.SBQQ__Description__c = 'Testing';
sbql.SBQQ__ListPrice__c = 2500;
sbql.SBQQ__ProratedPrice__c = 2500;
sbql.SBQQ__RegularPrice__c = 2500;
sbql.SBQQ__SpecialPrice__c = 2500;
sbql.SBQQ__CustomerPrice__c = 2500;
sbql.SBQQ__NetPrice__c = 2500;
sbql.SBQQ__SubscriptionScope__c = 'Quote';
sbql.SBQQ__ProrateMultiplier__c = 1;
insert sbql; // flow error dml exception

Process Builder

  • Fires when quote line item created / edited
  • Executes an update action on "[SBQQ__QuoteLine__c].SBQQ__OpportunityProducts__r"
  • Sets "Client Price" (OpportunityLineItem.Client_Price__c) equals to "[SBQQ__QuoteLine__c].Client_Price__c"

Debug Logs

[antlib:com.salesforce:deploy] 15:50:31.143 (62335276348)|WF_FLOW_ACTION_BEGIN|09L0M0000004HsC
[antlib:com.salesforce:deploy] 15:50:31.336 (62336164157)|FLOW_CREATE_INTERVIEW_BEGIN|00D1g0000004dQd|3000M000000Zgad|3010M0000004W1F
[antlib:com.salesforce:deploy] 15:50:31.336 (62425471385)|FLOW_CREATE_INTERVIEW_END|562737cc6c0242507d112f5119da162455b3b8-2b47|Quote Line | create/edit | Set Client Price on Oppty Product
[antlib:com.salesforce:deploy] 15:50:31.427 (62427064100)|FLOW_START_INTERVIEWS_BEGIN|1
[antlib:com.salesforce:deploy] 15:50:31.427 (62427093239)|FLOW_START_INTERVIEW_BEGIN|562737cc6c0242507d112f5119da162455b3b8-2b47|Quote Line | create/edit | Set Client Price on Oppty Product
[antlib:com.salesforce:deploy] 15:50:31.427 (62450511957)|FLOW_START_INTERVIEW_END|562737cc6c0242507d112f5119da162455b3b8-2b47|Quote Line | create/edit | Set Client Price on Oppty Product
[antlib:com.salesforce:deploy] 15:50:31.427 (62500742019)|FLOW_START_INTERVIEWS_END|1
[antlib:com.salesforce:deploy] 15:50:31.143 (62500954126)|WF_FLOW_ACTION_END|09L0M0000004HsC
[antlib:com.salesforce:deploy] 15:50:31.143 (62500970819)|CODE_UNIT_FINISHED|Workflow:01I30000002fijW
[antlib:com.salesforce:deploy] 15:50:31.143 (62504135980)|DML_END|[578]
[antlib:com.salesforce:deploy] 15:50:31.143 (62505438522)|FATAL_ERROR|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 3010M0000004W1F. Flow error messages: <b>An unhandled fault has occurred in this flow</b><br>An unhandled fault has occurred while processing the flow.  Please contact your system administrator for more information.  Contact your administrator for help.: []
[antlib:com.salesforce:deploy] 
[antlib:com.salesforce:deploy] Class.OpportunityCloneW_SBprimaryQuote_Test.createSBQuoteLine: line 578, column 1
[antlib:com.salesforce:deploy] Class.OpportunityCloneW_SBprimaryQuote_Test.testCloneQuoteLines: line 304, column 1
[antlib:com.salesforce:deploy] 15:50:31.143 (62505463371)|FATAL_ERROR|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 3010M0000004W1F. Flow error messages: <b>An unhandled fault has occurred in this flow</b><br>An unhandled fault has occurred while processing the flow.  Please contact your system administrator for more information.  Contact your administrator for help.: []

Discussion

I'm aware of the issue with flows where referring to fields on a parent record results in an error if the lookup field is null (i.e. trying to update case.Account.Name if case.AccountId is null). But in this case we're updating a set of child records, so in theory that can never be null, just an empty list. Additionally, it seems like it should be fine if either the opportunity line item or quote line item "client price" fields are null, since in that case the flow would just update the values to null.

The debug logs don't shed any light on what the error might be, no downstream trigger errors, no additional exception details that are buried in the debug log.

So I'm stumped, what could this be?

  • 2
    My solution would be to rewrite as Apex Trigger. You're going to have a hard time providing friendly error handling via flow. – Adrian Larson Mar 20 '18 at 22:10
  • Yeah, still torn on whether process builder is amazing or whether the downstream issues w/apex it creates are worse than just going with apex from the get go. – Ralph Callaway Mar 20 '18 at 22:17
  • 2
    If you have the skills to do Apex, it's better. Hands down. Where PB shines is if you don't have the skills to write a trigger, the time to train yourself, nor the resources to hire someone who does. – Adrian Larson Mar 20 '18 at 22:18
  • Was struggling with the same in one of my projects. Debug log/ Exception notification or UI errors nothing is giving enough information rather than saying 'An unhandled fault has occurred...' What we did was finding the PB name and analyse it for any possible NPE, validation failures, etc. – highfive Mar 21 '18 at 4:05
  • @highfive yep, that's what i've been doing, this one is just so straight forward and doesn't seem to be possible to have an NPE, so i'm stumped – Ralph Callaway Mar 21 '18 at 4:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.