My org does almost all our sales from Parent (Partners), and as such every lead has a parent account attached to it. What I want to do is make it so that upon lead conversion, the parent account ID is automatically there in Account Stage.
As it stands, I cannot do custom field mapping from lead stage as the Parent Account (hierarchy) field is a default field.
So what I have done is mapped the Restricted Picklist of Parent_Account__c from lead stage to a restricted picklist called Parent_acc_mapped__c in Account Stage.
I then went to process builder and created a process where it executes the Object Account (when a new record is created or edited).
The criteria was:
Parent_acc_mapped__c ISNULL = FALSE AND ParentID ISNULL = TRUE AND parent_acc_mapped__c DOESNOTEQUAL ParentIDThis is so that it only updates it for those converted from lead stage, whereas users who skip that and go straight to creating a new account can pick the parent account as they wish.
The action to be executed upon meeting those criteria are:
Update a record
Parent Account ID FORMULA TEXT([Account].Parent_Acc_mapped__c )
I have made sure that every one of the picklist options that can be selected are already Accounts themselves so that they can be made Parents.
However upon activating this process and testing a lead conversion, I get this error:
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 3016F000000Xjcv. 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.handleRegularAccountInserts: line 226, column 1 Class.leadconvert.BulkLeadConvert.convertLead: line 88, column 1
As seen in the image :
I suspect it has something to do with the fact that Parent Account is an ID field and my picklist is, well, a picklist.
I normally use the REFERENCE field__c instead of FORMULA TEXT(field__c), but in this case it didn't allow me since one was an ID field and the other was a picklist.
Any ideas on how this can be solved? It is tedious having to update the Parent Account of each account individually upon lead conversion.
I tried writing an Apex trigger in my Developer Edition as referenced in my other post here https://developer.salesforce.com/forums/ForumsMain?id=9060G000000XiSjQAK but upon running it, nothing happened upon lead conversion. It's as if nothing changed.
Would appreciate any advice on this please! :)
Once again, Merry Christmas!!!