Leads, Prospects, Contacts, and Customers?

You have to initiate communications, events from Leads/Prospects/Opportunities/Quotations
Not directly from contacts.
From V14 All the communications will be carry forwarded to subsequent documents. If you have created a Prospect from Lead, all the communication with respect to Lead will be carry forwarded to the Prospect. You don’t have to come back to Lead for communication records.

This is a very valid concern. One I am dealing with this afternoon. Because the data doesn’t stay synchronized, I am forced to write code to perform that synchronization. (had to do something similar last year, for 'Contact' and 'Customer')

However, I’m also facing a 'Lead'-specific challenge this time (Version 13, btw):

  • Lead has a single field named “Person Name”.
  • Contact has both “First Name” and “Last Name” fields.
  • When you create a Lead, it automatically creates a Contact.
    • How does it know how to transform 1 “Person Name” into “First Name” + “Last Name”? Answer = there is a simple formula/algorithm that performs the string-splitting.
    • However this formula will often be incorrect for people with multi-word First or Last names. :slightly_frowning_face:

So…need to fix that too. Either adding 2 new fields to 'Lead'. Or making its “Person Name” read-only, and driven by the Contact data. Haven’t decided yet.

:fork_and_knife:

2 Likes

I don’t really understand the concept of contact customer and prospect.

I understand that contacts are the singular such as an individual at a company (when the company is the customer)

In a b2b scenario that’s fine, though we mostly only deal with one person at a company.

In a b2C scenario it makes sense to just have a customer.

Apart from this I have no idea what a prospect is used for.

I understand it’s the equivalent of an opportunity but for the company but it makes it very complicated and unnecessary to have the functionality.

I wouldn’t mind if you could disable the doctype but for some reason I can’t. I assume it’s a master.

I can’t even hide the buttons correctly on the uk with client scripts.

A challenge with ERPNext (and many other ERPs), is trying to be “One Size Fits Most”. To create a set of DocTypes that meet the needs of as many customers as possible. Without becoming too specialized.

I’ve often encountered ERPs with CRM concepts such as Lead, Opportunity, Prospect, Campaign, etc.
However, rarely do I meet customers who want to use 100% of these features. But some do, so ERPNext has the building blocks to support them.

Prospect is a step halfway between Lead and Customer.

  • Leads could be unqualified. I could give you a phone number, 555.123.4567, and tell you "this is a lead for sales". You know nothing yet, besides this piece of information.
  • Prospect is more than that. Perhaps you called the number, spoke to a person, and discussed your business. They seemed interested. But so far, they have not bought anything from you. So not a Customer yet.

A single Contact can be associated with any, or all of these.

  • Contact A → points at Customer CUST-0002334.
  • Contact A —> points at Lead LEAD-0009333.
  • Contact A —> points at Prospect PSP-02024.

Same human, just different relationships.

To hide these DocTypes, you could alter the Roles and Role Permissions. Make sure that no one has access to see them.

2 Likes

Thank you for taking the time to write a detailed post,

I understand, propect is a holder for all the tasks, emails, meetings etc that relate to the lead, opportunity and customer modules,

I agree with you about one size fits most because alot of the work is stripping back alot of the functionality. I am busy customizing the erp for my company. Im trying to build alot of the automations with client side scripts.

Do you know where i can get a list of these things

frm.add_custom_button
frappe.ui.Dialog

  1. fieldname_add

Also i am adding custom buttons to my form Attached pin.

removing the create button seems to break the activities tab in the lead fform.

could you also point me towards an article that can help me understand how to build automations with client side scripts,

IE) on button press

create opportunity
add task
send email

Here’s some of the Official Documentation:

If you are experienced and lucky, this might be enough to help you. However, the documentation never really helped me. I had to teach myself by studying examples.

The JS code for the 'Lead' DocType is actually a really great beginning. If you study this code, it demonstrates how to:

  • Add custom buttons
  • Teach your buttons to call other JS functions.
  • Teach your JS code to call Python serverside code.
  • How to create a Dialog widget.

Link to Lead DocType JS code: (erpnext/erpnext/crm/doctype/lead/lead.js at develop · frappe/erpnext · GitHub)

This won’t explain everything. But some things you can skip right now.

For example, there is not a comprehensive explanation of the purpose and differences between the 'setup', 'before_load', 'on_load', 'refresh', and 'onload_post' methods.

Or why sometimes this syntax is used:

erpnext.LeadController = frappe.ui.form.Controller.extend({
  ...
}
extend_cscript(cur_frm.cscript, new erpnext.LeadController({ frm: cur_frm }));

…but other times this syntax:

frappe.ui.form.on("Lead",  {
...
});

…but sometimes both simultaneously.

Even after 6 years, I still don’t really understand some of it. Perhaps if my programming background was in Flask or Django, I wouldn’t struggle as much. :man_shrugging:

However, you can achieve “good enough” by examining the standard code, copying and pasting components, and altering for your own needs.

And whenever we have doubts, well…there’s always console.log(); :slight_smile:

1 Like

From what I’ve learned in using ERPNext is that “Prospect” is similar to what most CRMs call “Accounts.”

A Prospect doesn’t represent a specific person you’re trying to sell to, but rather an entity. In a standard Business-To-Consumer transaction, the Prospect might be just one person. For example if I sell candles, there’s probably only one person involved in that buying decision.

In most Business-To-Business scenarios, the Prospect is really the business, itself. That Prospect might have several Leads and Contacts associated.

In something like a real estate transaction, the Prospect might be a family of people, as in a husband and wife couple. Since both the husband and the wife have to sign the home purchase documents (typically) it’s useful to have both people linked together as a Prospect.

Hey Brian,

Again thank you for the awesome reply, Being somewhat an amatuer with scripting i tend to be able to get myself around if i have a list of “what stuff is & what stuff does” if you know what i mean,

My first ever succesfull coding was in a very specific obscure language that was designed for a virtual instrument called kontakt. So it was somewhat similar to frappe in the sense that you would have seperate scripts that each call on each other for different puposes,

the gui script
the audio script
the functions script

Im sure you get the just, ill leave a link if you are interested to have a read.
They also had a tiny community where there where probably only 30 develeopers releasing commercial products.


Back to frappe.

I understand the concept of a python back-end and a JS front end.
In my mind im going to be using server side scripts to run my automations
(Assign tasks, Send Emails, Automate Reports Automate Workflows).

Then i will use JS to pretty much make buttons to simplify the user interface for my team.

Again the “catch all” approch with a platform as you said resukts in me not understanding half of the concepts, but also me having to strip these things back as much as possible.

What i am busy working on now,

Simplifying the lead form with single buttons (Image attached)

Successes:

  • Ceated Buttons
  • Removed “Create” and “Action”

Objectives:

  • Only Remove Prospect from create
  • Remove Action

Problems:

  • Code adds Buttons
  • Code removes both create and action completely
  • Removing create an action breaks activity tab in lead form

I will post an image and the code

frappe.ui.form.on('Lead', {
    refresh(frm) {

        // Add the 'Add Task' button
        frm.add_custom_button(__("Add Task"), function(){
            console.log("Add Task button clicked");
        });

        frm.add_custom_button(__("New Opportunity"), function(){
          console.log("Clicked")
      }); 
  
      frm.add_custom_button(__("Add Meeting"), function(){
            console.log("Clicked")
      });  

        // Add the 'Send Email' button
        frm.add_custom_button(__("Send Email"), function(){
            console.log("Send Email button clicked");
        });

        var bt = ['Customer', 'Opportunity', 'Quotation', 'Prospect']
        bt.forEach(function(bt){
            // frm.page.remove_inner_button(bt, 'Create')
            frm.page.remove_custom_button(bt, 'Create');
  
          });
    }
});


Thank you for pointing me to

I am assuming that i will find the relevant "info: in the same folder structure for other doctypes and forms.

are these functions

frm.add_custom_button

Also dotted over the repository or is there solid docs for it?

Also out of interest sake what do you do?, also out of interest sake would you be keen to collaborate with me to build a snippet/script library. Either for gratis or maybe we can make it a plugin for erp next. I am going to be writing alot of these little scripts.

EDIT: Sorry if i sound illiterate but dont have the time to spell check HAHAHA

Hey Bro,

I come from a zoho background so that makes alot of sense, but then my question is whats the point of the contact and customer.

Normal CRM:

Lead —> Opportunity ----> Contact(Contact at Company) and Account(Used for Company)

ERPnext:

Lead -----> Opportunity(Contact Created as well) --------> Prospect ------> Customer.

Lets not forget the other doctypes

Company

So either i need to remove Opportunity from lead and use the prospect as a wrapper, or i need to remove prospect?

what are you thoughts?

Hey Brian,

Can I ask you how you found this symbols thing in github, its flipping awesome, thats what i needed

Actually in ERPNext, a Contact is created when you create a Lead, even if you never convert them to an Opportunity.

A Contact in ERPNext represents a person (Or maybe just the name of a business), but without any context. As an analolgy, think of Contacts in ERPNext like contacts stored in your phone. You have some contacts in your phone that are customers/clients, but you also have friends, family, your barber shop, and the guy that you bought that boat from 8 years ago.

The Customer record is typically used moreso by the customer service/accounts receiveable departments than by sales. The idea behind the Customer record is that it’s used to keep records of AFTER the sale has taken place. As such, you don’t always see Customer records in other CRMs, because CRMs are often just designed to accommodate the sales department, and not customer service/accounting. In ERPNext, your customer service department might not ever touch Leads/Opportunity records, and your customer service/billing departments might not ever work with Lead/Opportunity records.

By default, In ERPNext it will typically work like this:

Lead Generated (trade show, marketing campaign, whatever) → Sales rep talks to Lead → If the Lead is somewhat qualified to buy, create Prospect (maybe link some other decision makers to the Prospect, too) → If an opportunity to make a sale exists, create an Opportunity. → follow up on opportunity until deal closes → Customer record is created.

A Company is something else entirely, and is actually for keeping track of YOUR company, not the customer’s. You can have multiple Companies in your ERPNext. For example, suppose you have an insurance company and a real estate brokerage. You might want to use the same ERPNext instance, but it’s like imperative to keep separate accounting books. So, your insurance company and your real estate brokerage can share Leads/Contacts/Whatever inside ERPNext, but the books can be kept segregated (for tax/regulatory purposes, and for performance/profitability analytics).

2 Likes

Here’s a screenshot of how to open the symbols:

There’s also an option to open it automatically on click:

They’re definitely all over the repositories. Here’s the official documentation for ‘add_custom_button’

Warning that for List Pages, it’s a bit different. For those you’ll want to use 'add_inner_button()'.
However, there is no “outer button”. Not sure why. :man_shrugging:

If “Prospect” is a qualified lead then what is the point of having the “qualification status” and “qualified by” fields in the Lead doctype?

Well, the term “qualified” means different things to different people. Some organizations may choose to convert a Lead to a Prospect if they have a valid Opportunity that might close. Other organizations may choose to convert the Lead to a Prospect once they’ve determined that the Lead actually represents a real person or entity that can buy from them.

From what I can tell, the Qualifcation Status and Qualified By Fields aren’t actually tied to any specific functions within ERPNext, so you could always just disregard those fields if you don’t find them useful.

How I use is as follows:
Lead created > Sales rep contacts Lead > If Lead is unqualified for some reason, the Sales Rep updates the “Qualified By” and “Qualified On” fields. That way, I can generate a report of Leads that have been disqualified within specific date ranges, which is useful to know when to reach back out to that lead again.

1 Like

I’m on v15. There is a checkbox in CRM Settings that blocks the creation of contacts when adding leads. This is helpful for me, because I use contacts as my companies centralized Contacts book.

1 Like

v15.17
I set Auto Creation of Contact : N on all installations.

That means that a Contact has to be created manually, avoiding the probability of having a separate Contact evolved from the Lead / Opportunity detail differing from a bona fide Contact.

With regard to a Prospect:
1 Gartner says a Prospect is a potential customer who has been qualified as meeting specific criteria that indicate an ability and likelihood to buy.
2 Hence hinting at a B2B type of stage after Opportunity but before Customer
3 A Prospect can be linked to multiple Leads and Opportunities
4 Hence it’s actually a B2B step in between an Opportunity / Quotation and a Contract / Customer

Respectfully, what Gartner (or anybody else) has to say about what a “Prospect” means basically nothing in an ERPNext context.

A better analog for the Prospect DocType is what most other CRMs would call an “Account,” wherein the record is used to keep track of a customer or potential customer, but doesn’t represent a single person.

One of the unfortunate failings of Frappe/ERPNext is that you can’t rename DocTypes, at least not without a lot of headaches. They really should have implemented some method to set an “alias” for DocTypes so people could change the nomenclature…

You don’t necessarily need to think of a Prospect in ERPNext as a stage in the sales process, or consider whether they’re qualified or not. You certainly can create a Prospect before you create an Opportunity, or create the Prospect immediately after creating the Lead(s).

One scenario where you might want to do this is when you have multiple Leads in the same company. You might have one Lead that represents the CFO, one that represents the office manager, and one that represents one of the purchasing clerks. In situations like that, it might be fruitful to create a Prospect and link all of those Leads to that one Prospect, then work from the Prospect record, especially if you are calling on multiple Leads in pursuit of the same sale.

Hello @oguruma

The only reason I mentioned Gartner, is that I was compelled to do extensive research as to what a Prospect means since the Frappe documentation does not mention the concept at all. Nowhere is there any elucidation as to what a Prospect is.

I’ve uncovered that Salesforce uses the Prospect term very differently to how I understood Frappe to use it and the closest resemblance to how it is used in Frappe came from Gartner.

You can actually create a Prospect without any predecessor or link to any of the other CRM sales stages such as Lead or Opportunity. It is completely independent and acts very much as a Contact. Of course it has to be linked to a Lead or Opportunity at some stage but nothing prevents you from creating it upfront.

I do not think of a Prospect as a distinct stage in the sales cycle, but rather at what stage in the sales cycle does it become meaningful / useful. Hence I concluded that in most “non complex” sales cycles it is not necessary and only becomes useful in a B2B scenario where the Lead has progressed to an Opportunity and maybe even a Quotation was submitted. However the sale is not concluded for reasons pertaining to the complexity of the organisation’s purchasing process, introducing other role players. Things such as Vendor approval / creation and signing a Contract may delay the sales pipeline from progressing to a Customer. A Prospect is then used to relate all of these. In most B2C scenaria this is irrelevant and a Prospect is unnecessary.

Sorry about that. I misunderstood what you were trying to convey.

You’re right that ERPNext team hasn’t been great at explaining and documenting to end-users or developers what exactly their philosophy was as it pertains to the different DocTypes.

More generally, with regards to Prospects/Leads/Accounts/Opportunities, etc. I tend to abandon any preconceived notions as to what these terms “mean” when I start working with another organization. For example, to some organizations, the term “Prospect” means a qualified Lead. To others, a “Prospect” means an unqualified or cold “lead.”

To make it more confusing some organizations even have other record types to represent a different stage in the process. For example, I used to implement SuiteCRM, which has the record of “Targets” which are basically completely unqualified “leads” (typically purchased from a list or something).

With respect to prospects, it’s ultimately up to the users how they wish to handle that. I have one realtor client that works exclusively with residential buyers/sellers, which would represent a B2C scenario. Her team uses Prospects in ERPNext to encapsulate all of the client stakeholders into one record - the husband, the wife, the overbearing mother-in-law, etc.

I do B2B, so I use it basically the same way you do, with the exception that if I have multiple Leads for the same organization, I create a Prospect, even if I haven’t even called on any of the Leads yet.

When I first started working with ERPNext, the CRM module was quite frustrating. However, after using it for a while, I quickly started to prefer the way the data is structured compared to other CRMs.