Salesforce’s standard Lead Conversion leaves a lot to be desired, unfortunately.
For example, the standard conversion process does not create an association between a Contact and an Account unless you are:
1. Creating a new Account and new Contact;
2. Creating a new Contact to associate to an existing Account; or,
3. Creating a new Lead using an existing Account and an existing Contact associated to that Account.
Thankfully, they have provided the means to enhance the functionality without touching a single line of Apex. As a note, this presumes that your org is configured to allow Contacts to be associated with multiple Accounts AND that you’re expecting an Account, Contact, and Opportunity as an output of the conversion process. So, the scenario below works IF you are creating a new Account and associating it with an existing Contact (who has a primary relationship with a different Account).
This can be achieved by creating a Process in Process Builder for the Lead object that checks that:
– “IsConverted” flag is checked; and,
– “ConvertedOpportunityId”, “ConvertedAccountId”, and “ConvertedContactId” are not NULL.
This combination of fields validates that the Lead has been corrected converted and has the appropriate association with the downstream objects/records. The flow then takes the record ID of the Lead as its initial input (we created a custom field to store this value just as an internal validation). From that Lead record it returns the IDs in the “ConvertedAccountId” and “ConvertedContactId” fields. These ID values are then used to query the Account Contact Relationship object to determine if a relationship currently exists. If the answer is “No” then we create that relationship (which appears as the secondary relationship for the existing Contact). If the answer is “Yes” then we proceed to the next step. This step makes updates to the Opportunity record (e.g., changing a field value and updating the Oppty name per a specified naming convention).
Not without an issue…
There is, however, a final scenario in which Salesforce presents a glaring bug, limitation, issue (whatever you want to call it – but it’s been submitted to Salesforce as a bug) that this Process and Flow does not cover. This scenario is when you want to convert a Lead that points to an existing Account and an existing Contact who does not have an existing relationship with the specified Account. For example,
– Contact 1 has a relationship with Account 1
– You create a Lead with Account 2 and Contact 1
During the conversion process Salesforce ignores the Account specified and substitutes in the Account that’s associated with the Contact. Bug logs, unfortunately, provide no clues as to the cause. Workarounds do exist but…they require additional fields on the Lead which, in turn, rely on user input and would require an update to the Flow to take this additional data into consideration. Hopefully (fingers crossed), Salesforce responds to my case with an update in the near future!! If/when they do I’ll post an update.
If you’d like to see how CleanSlate can help you take full advantage of your Salesforce org please shoot us an email!