function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dan KiddDan Kidd 

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER

Hi,

I'm getting the below error when converting a lead to an opp:
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 301D00000004I5q. 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.: [] Class.leadconvert.BulkLeadConvert.handleOpportunityInserts: line 413, column 1 Class.leadconvert.BulkLeadConvert.convertLead: line 106, column 1

I've tried hitting the URL for ~/301D00000004I5q and it throws an "Insufficient privileges" error despite me being a full admin.

Thanks,

Dan

Waqar Hussain SFWaqar Hussain SF
Somehow your process builder is not running and causing an error. The flow id is 301D00000004I5q
Dan KiddDan Kidd
How can I ID which process builder flow is running?
D
Waqar Hussain SFWaqar Hussain SF
I think you can put the ID of the flow as a below URL that will open the underlying flow, where you can see the flow name.

https://[instance].salesforce.com/designer/designer.apexp#Id=[id]
 
Maharajan CMaharajan C
Hi Dan,

Please use the below things and read carefully there is a some repro for that:

Lead convert fail when there is Lead (Process builder) trying to update the lead during the conversion.
Knowledge Article Number000232516

DescriptionIf you have a process created for the Lead object in the process builder, you may encounter an error similar to the one below when trying to convert a lead.

"Error: System.DmlException: Update failed. First exception on row 0 with id XXXXXXXXXXXXXXX; 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 XXXXXXXXXXXXX. Contact your administrator for help.: [] Class.leadconvert.BulkLeadConvert.updateLead: line 1375, column 1 Class.leadconvert.BulkLeadConvert.convertLead: line 151, column 1"

This will happen if the process you have created for leads is trying to update the lead when it's converted. When a lead is converted, some values on the lead are updated automatically and therefore, if the process is set to start "when a record is created or edited" and the criteria on is met, the process will try to update the lead after being converted, which is not possible. 

 
ResolutionAn easy way to avoid this is adding a criteria to the process to check if lead.IsConverted is Equals False and only make updates when the lead is not being converted.

If the above don't solve this issue:

Please use the below one to refer: 
https://success.salesforce.com/issues_view?id=a1p300000008YatAAE

Can you please Let me know if it works or not!!!

If it helps don't forget to mark this as a best answer!!!

Thanks,
Raj
 
Dan KiddDan Kidd
Thanks Raj, this is really useful. It looks like a 3rd party (managed package) is what's causing this to fail so I've logged a ticket with their support to see what happens. I've passed on your advice though, when they come back I'll be sure to mark this as best answer!
Thanks
Dan
 
Nathalia CaicedoNathalia Caicedo
Great answer thank you @Maharajan you just solved my problem