Skip to main content

Custom Statuses

Custom Statuses allow you to control which status options appear in the Lead or Deal status dropdown. Instead of showing every available status, you can create customized status flows based on your business process.

You can define different status lists based on document field values, allowing different teams, products, or services to follow their own sales pipelines.

Tip

Customize status flows based on your actual sales process. Showing only relevant statuses helps users follow the correct workflow and reduces incorrect status updates.

How Custom Statuses Work

Custom Statuses are configured using a CRM Form Script. By setting this.statuses as an array of status names, you can control which options are displayed in the Lead or Deal status dropdown.

Only statuses that exist in the CRM Lead Status or CRM Deal Status master will appear.

Before using a new status:

  1. Open CRM Settings → Statuses.
  2. Create the required Lead or Deal status.
  3. Reference the exact status name inside your CRM Form Script.

Important

Status names are matched exactly. If a status does not exist in the CRM Status master, it will be ignored and will not appear in the dropdown.

Creating Custom Status Lists

The status list is defined inside a CRM Form Script class for your Lead or Deal DocType. Since the list uses JavaScript, you can apply conditions and customize the workflow based on any document field.

Basic Example — Static Status List

You can define a fixed list of statuses that should appear in the dropdown.


class CRMLead {
    onLoad() {
        this.statuses = [
            "New",
            "Contacted",
            "Qualified",
            "Nurturing",
            "Lost"
        ]
    }
}

This configuration displays only the selected statuses in the same order as defined in the array.

Dynamic Statuses Based on Field Values

You can create different status pipelines based on field values. For example, Product and Service Deals can follow different sales stages.

Status Product Pipeline Service Pipeline
Qualification
Demo/Making
Proposal/Quotation
Negotiation
Ready to Close
Won
Lost

class CRMDeal {

  onLoad() {
    this._updateStatuses();
  }

  custom_deal_type() {
    this._updateStatuses();

    if (this.doc.status && !this.statuses.includes(this.doc.status)) {
      this.doc.status = this.statuses[0];
    }
  }

  _updateStatuses() {

    if (this.doc.custom_deal_type === "Product") {

      this.statuses = [
        "Qualification",
        "Demo/Making",
        "Negotiation",
        "Won",
        "Lost",
      ];

    } else {

      this.statuses = [
        "Proposal/Quotation",
        "Negotiation",
        "Ready to Close",
        "Won",
        "Lost",
      ];

    }

  }

}

The _updateStatuses() function runs when the document loads and whenever the custom_deal_type field changes.

If the current status is not available in the newly selected pipeline, the script resets the status to the first available option.

Adding Custom Status Names

If the default statuses do not match your workflow, you can create new statuses from CRM Settings and use them inside your script.

For example, a Service pipeline may require an additional stage such as Consultation/Inquiry.


class CRMDeal {

  onLoad() {
    this._updateStatuses();
  }

  _updateStatuses() {

    this.statuses = [
      "Consultation/Inquiry",
      "Proposal/Quotation",
      "Negotiation",
      "Won",
      "Lost",
    ];

  }

}

Note

Always create custom statuses in CRM Settings before referencing them in your script. Invalid status names are ignored without displaying an error.

Default Lead Statuses

Name Type Position
New Open 1
Contacted Ongoing 2
Nurture Ongoing 3
Qualified Won 4
Converted Won 5
Unqualified Lost 6
Junk Lost 7

Default Deal Statuses

Name Type Position Probability
Qualification Open 1 10%
Demo/Making Ongoing 2 25%
Proposal/Quotation Ongoing 3 50%
Negotiation Ongoing 4 70%
Ready to Close Ongoing 5 90%
Won Won 6 100%
Lost Lost 7 0%

Reference

Property Type Description
this.statuses string[] Array of status names displayed in the dropdown. It can be updated anytime during the script lifecycle.

Behaviour Notes

  • Order: Statuses appear in the dropdown in the same order as defined in the array.
  • Missing Statuses: Status names that do not exist in CRM Settings are ignored automatically.
  • Reactivity: Updating this.statuses after page load refreshes the dropdown immediately.
  • Status Reset: Changing pipelines does not automatically clear the current status. Use the includes() check to reset invalid statuses manually.

Best Practice

Keep status pipelines simple and aligned with your actual sales process. Too many unnecessary stages can make tracking progress difficult for users.

Rating: 0 / 5 (0 votes)