Admins / Architects / Flow / Platform / Sales / Sales Cloud

Overcoming Limitations of the Salesforce Lead Object

By Timo Kovala

Leads: a Salesforce staple and a standard object that every admin and developer should be well familiar with. The lead object has been around roughly as long as the platform itself, a whopping 25 years. Its central idea has remained the same: to act as a virtual stack of business cards so that sales can document ‘fuzzy’ business prospects without committing unverified data to actual accounts and contacts. Leads essentially function like a mudroom – they act as a buffer to keep your account data dirt-free. However, this lofty goal is overshadowed by a heap of problems.

The lead may have served its purpose back in the noughties, but it seems outdated in this day and age. For one, the linear sales funnel has been replaced by sales cycles (circular vs. linear) and customer journeys (customer-centric vs. product-centric). In addition, mature businesses may see ex-customers re-enter as leads after a while. Not to mention that an individual may be involved in several lead processes at various stages simultaneously. We come to the conclusion that the lead object alone does not meet today’s complex sales process requirements.

Is the Standard Lead Object Needed?

You may be tempted to eschew the standard lead object altogether. You can certainly do that if your Salesforce data model permits it. This does have some key considerations to bear in mind.

For one, your marketing automation platform may rely on both leads and contacts, as is the case with Marketing Cloud Account Engagement (Pardot). Secondly, if you remove the standard lead from the process, you need to ensure that early-stage business prospects with limited or unreliable info don’t contaminate your contact data. You may also opt for a hybrid approach, where you use Apex to automatically convert leads into contacts and accounts whenever they meet certain criteria.

Alternative Approaches for Managing Multiple Leads per Individual

The beauty of Salesforce is that there’s virtually endless potential for customization – there’s no need to stick with what comes out of the box. Lead management being one of the core functions of a CRM system, I shudder to think how many dollars have been spent to work around the standard lead data model. How to handle leads is one of those never-ending debates in the Trailblazer community. Countless admins and consultants alike have toiled hard to build the perfect lead management model, often reinventing the wheel in the process.

I’ve seen countless different approaches to lead management in Salesforce, but they all fall under one of the following central pillars:

  1. Tasks to notify account owners of new leads
  2. Early stage opportunities as leads
  3. Campaign members as leads
  4. Custom object records as leads

Tasks as Leads: Pros and Cons

Pros

Tasks are well suited to be handled as makeshift leads. They have built-in many-to-one relations with both the contact and lead object. They can be assigned to an individual user or a queue (albeit without the use of standard lead assignment rules). Furthermore, tasks are one of the few objects whose records can be created from Marketing Cloud Account Engagement (Pardot).

Cons

Under the hood, tasks are actually two objects in one: activity and task. This causes unnecessary complexity when building a task-based process. Tasks are also displayed differently on the UI than other related objects since they don’t use a regular related list view but the activity timeline. This is good for reminders and call logs; not so much for monitoring open leads. Overdue tasks tend to get hidden ‘below the fold’ if there are several other activities like email clicks, causing you to miss out on important leads.

Opportunities as Leads: Pros and Cons

Pros

Opportunities are very similar to leads, in that they too are meant to lead to a deal. The differences between the two are debatable, but I see opportunities as having all the information needed to present a proposal: buyer, need, value proposition, timeline, probability to win, and estimated amount. You don’t technically need to have all these as required fields, particularly if you have a “lead” stage or record type in use for early-stage opportunities.

Cons

There are some key limitations to this approach. For one, opportunities map to accounts by default. To enable lead management on a contact level, you can leverage opportunity contact roles. However, contact roles are actually another junction object, adding complexity to processes and automations. Furthermore, if you generate opportunities for each lead – even an unqualified one – you end up with lots of irrelevant, inaccurate, and confusing opportunities, obscuring the sales pipeline. Opportunities also don’t map to lead records by default. If you were to create an opportunity via Flow based on a lead, it would lead to an ‘orphaned’ opportunity, i.e. opportunity that does not have an associated account or contact roles.

Campaign Members as Leads: Pros and Cons

Pros

Campaign members are a hidden gem that not all admins are aware of. A campaign member is a junction object that creates a many-to-many relationship between campaigns, contacts, and leads. This means that a single contact or lead may belong to several campaigns, and a single campaign can contain several contacts and leads. This out-of-the-box relationship with both contacts and leads lends itself nicely to many-to-one lead management.

Cons

As you might have guessed, the campaign member approach too has its flaws. One limitation is that you cannot set up a tab for campaign members. With standard features, there is no way of displaying campaign members across all campaigns on a single list view. You would need a custom LWC or an extension like Simpli or ZaapIT to achieve this. You can only view the list of members for a single campaign through the related list component on campaigns.

Another limitation is that if you want a web form or other asset to be able to generate several leads per prospect, you cannot do that with just campaign members – campaign members have a one-to-one relationship with contacts and leads, so they can only exist once per person per campaign. Campaign members also do not support lookups from custom objects, but can be referenced by Flow and Apex.

Custom Object as Leads: Pros and Cons

Pros

Through a process of elimination, we eventually land on the custom object approach. Custom objects naturally bring a wide range of flexibility. You can set up all the fields, layouts, permissions, and metadata from scratch. Yes, it’s all manual work, but at least you aren’t restricted by standard objects’ UI/UX limitations. Setting up the required relationship is easy, all you need is lookup fields on the custom object referring to the parent contact and lead records. My recommendation is to also include a campaign lookup so that you’ll have an easier time pulling all the required information for future flows and formula fields.

Cons

The downside is that custom objects don’t have access to all the bells and whistles that standard objects get. For instance, standard features like sales territories, lead assignment rules and queues, and the lead conversion screen are not available for custom objects. You must either learn to live without them or replicate the functionalities with Flow, LWC, and Apex.

The data model using a Marketing Lead custom object could look something like this. Notice that the custom object only has many-to-one relationships to other objects (contact, lead, and campaign).

Automating Custom Lead Qualification

Lead qualification is just a fancy term for sorting which ones are ok to proceed with, and which ones are rubbish. Regardless of the method you decide to use for managing a many-to-one relationship between marketing leads and contacts, you need to build custom automations, i.e. flows, to ensure everything runs smoothly.

To build a functioning lead management model, the following functionalities need to be built with Flow:

  1. Triggered lead creation
  2. List view of current and past leads
  3. Lead conversion and rejection

Triggered Lead Creation

The logical starting point when building a custom lead process is the trigger that starts the whole thing. Assuming you are running Marketing Cloud Engagement or Account Engagement (Pardot) as your marketing automation platform, the most likely candidate for a trigger is the campaign member. As pointed out above, campaign members can function as makeshift leads by themselves, but this approach comes with limitations. A better alternative is to use a combination of campaign members and any of the other options.

Building on this idea, we trigger the lead creation Flow based on a campaign member being created. If you have a recurring campaign that should allow for multiple leads per individual, you need to do a workaround, like reverting the campaign member status back to “sent” in order to enable new marketing lead creation to be triggered as needed. The flow should fetch the relevant field values from the campaign member, campaign, contact/lead, and account, and use these to populate the new task, opportunity or custom object record.

You can use two methods for this:

  • Assignment and record creation
  • Transform and record creation, based on personal preference

Note: If you use Marketing Cloud Account Engagement, ensure that the relevant prospect fields are mapped to contacts and leads. You then need to add a decision element in the Flow to check whether the campaign member is related to a lead or contact and have the record creation use the correct contact/lead to populate the task, opportunity, or custom object record. This is a better alternative to using formula fields, as the contact/lead field values can become overwritten by future form submissions etc.

List View of Current and Past Leads

As mentioned, a key issue with campaign members is that no tab or combined list view is available for them – you can only view campaign members as a related list, on a campaign-by-campaign basis. For lead qualification, we want the ability to view all leads in one place and filter them as needed. This is where the second object comes into play. For tasks and opportunities, you can set up a Marketing Lead record type to make it easy to set up list views for lead qualification. For custom objects, it is only a matter of setting up a custom tab.

READ MORE: Creating Salesforce Custom List Views

Lead Conversion and Rejection

A custom lead process wouldn’t be much good if you couldn’t do anything with the leads. The minimum requirement is that a marketing lead can be either:

  • Converted to a sales opportunity
  • Rejected and archived

Building a custom lead rejection button is easy: simply set up a quick action or button that updates the record’s status from “open” to “rejected”. Having the status as a list view filter instantly hides the rejected leads from view. Conversion is where things get tricky fast.

Salesforce’s standard lead conversion functionality looks and feels ok, if slightly unpolished. For one, it would be nice if it would redirect to the newly created opportunity or contact instead of a generic list view. Unfortunately, the standard lead conversion feature cannot be customized or added to tasks or custom objects. If your lead process uses early-stage opportunities as leads, the conversion would be a simple matter of changing the record type or opportunity stage. For tasks, campaign members, and custom object records, this has to be replicated using Flow and Apex.

Using a Screen Flow, we can create a quick action or button to create a new opportunity based on the parent record’s field values. This follows a straightforward get records > assignment > create records process that you should be familiar with if you’ve used Flow in the past. So, what do we need Apex for? Apex is required when the lead we want to convert is mapped to an actual lead record. To avoid creating orphaned opportunities, we need a piece of Apex code to ensure that the actual lead record is converted behind the scenes as we create an opportunity via the task, campaign member, or custom object record.

The dynamic related list component can be used to show the custom leads under each contact in a clean, user-friendly way.

READ MORE: Converting Leads with Apex

Summary: Fault Paths

Building anything custom brings its own risks. Leads may not always get created, they may get duplicated, or lead conversion might stop working. As an admin or developer, it is in your best interest to assume the worst and prepare for it.

Liberal use of fault paths in your Flows combined with an error message screen flow and/or email notifications is key in creating a successful custom process. An early notice can give you valuable time to flip a kill switch, send a mass notification to sales and marketing users, and repair the faulty solution before lasting damage has occurred.

READ MORE: How to Solve Salesforce Flow Errors

The Author

Timo Kovala

Timo is a Marketing Architect at Capgemini, working with enterprises and NGOs to ensure a sound marketing architecture and user adoption. He is certified in Salesforce, Marketing Cloud Engagement, and Account Engagement.

Leave a Reply