ERPNext DocTypes: The Building Blocks of Custom Workflows

ERPNext & Frappe Development

03 August, 2026

what-is-doctype-in-erpnext
Jaymin Lakhmanbhai Tarpara

Jaymin Lakhmanbhai Tarpara

Sr Developer, Softices

Every record, form, workflow, report, and approval process in ERPNext is built on a DocType. Whether you're creating a Sales Invoice, managing Employees, tracking Inventory, or building a completely custom business application, DocTypes define how data is stored, displayed, and managed. They determine how your business processes are structured and are the foundation of every module in the system.

But what exactly is a DocType, and why does almost everything in ERPNext and Frappe revolve around it?

In this guide, we'll explain:

  • What a DocType is
  • How DocTypes work in ERPNext
  • The different types of DocTypes
  • How they're used in ERPNext customization
  • How they power custom Frappe applications
  • Best practices and common mistakes to avoid

What is a DocType?

A DocType (Document Type) is the primary data model used by the Frappe Framework. Think of it as a blueprint that defines everything about a particular business record.

A DocType Determines:

  • What data is stored (through fields such as text, numbers, dates, links, and tables)
  • How data is displayed (form layouts, list views, and report generation)
  • Who can access or edit data (via role-based permissions and user access controls)
  • What rules govern the data (validations, permissions, and automated workflows)
  • The underlying business logic (through server-side scripts, client-side interactions, and trigger-based actions)
  • How the DocType behaves (encompassing both backend logic and frontend responsiveness)
  • Reporting and output formats (custom reports and print-ready templates)

Every record you interact with inside ERPNext is based on a DocType.

Examples include:

  • Sales Invoice
  • Purchase Order
  • Customer
  • Supplier
  • Employee
  • Item
  • Project

When you open one of these forms, you're simply viewing a DocType rendered as a user interface.

In simple terms: 

| If ERPNext were a building, DocTypes would be the bricks. 

Different combinations of bricks build different rooms, accounting, inventory, HR, but they're all made from the same fundamental unit.

Why DocTypes are the Foundation of ERPNext

Most users only interact with buttons, forms, dashboards, and reports.

Behind the scenes, however, developers build nearly every business process by configuring or extending DocTypes to shape how ERPNext behaves.

This approach offers several major advantages.

Highly Flexible

Almost every business requirement can be represented by either:

  • extending an existing DocType, or
  • creating a completely new one.

Metadata-Driven

Unlike traditional applications where forms are hardcoded, ERPNext stores DocType definitions as metadata. This makes customizations significantly easier to maintain.

Upgrade-Friendly

Because most changes happen in the metadata layer rather than the ERPNext core, customizations generally survive version upgrades with minimal effort.

Shared Across ERPNext and Frappe

The exact same DocType engine powers:

  • ERPNext
  • Custom F-commerce platforms
  • Customer portals
  • Vendor portals
  • Manufacturing systems
  • HR applications
  • Learning Management Systems
  • Industry-specific business applications

Thus, skills transfer directly between them.

Learning DocTypes means learning the foundation of the entire Frappe ecosystem.

Core Components of an ERPNext DocType

A DocType isn't just a collection of fields. It combines multiple components that work together to define both data and behaviour.

1. Fields

Fields define the information stored within a DocType.

Common field types include:

  • Text
  • Number
  • Currency
  • Date
  • Time
  • Checkbox
  • Select
  • Link
  • Table
  • Attachments
  • Images

Example: A Warranty Tracking DocType might include:

  • Warranty Expiry Date
  • Product Serial Number
  • Customer
  • Warranty Status

2. Permissions 

Permissions determine who can:

  • Create
  • Read
  • Edit
  • Delete
  • Submit
  • Cancel
  • Amend records

Permissions are role-based, making ERPNext suitable for organizations with multiple departments and approval levels.

3. Naming Rules 

Every record requires a unique identifier.

ERPNext supports several naming strategies, including:

  • Auto Increment
  • Naming Series
  • Field-based naming
  • Custom naming logic

Example:

SINV-2026-00045

4. Workflows 

A workflow controls how a document progresses through different stages.

For example:

Draft → Submitted → Approved → Completed

Workflows can include:

  • Multiple approvers
  • Conditional approvals
  • Role-based transitions
  • Email notifications
  • Status tracking

5. Client Scripts 

Client Scripts are JavaScript functions that execute inside the user's browser.

Common uses include:

  • Showing or hiding fields
  • Auto-filling values
  • Dynamic calculations
  • Validation before submission
  • User interface enhancements

Because they run in the browser, Client Scripts improve usability without changing server-side behaviour.

6. Server Scripts and Controllers 

Server-side logic handles business rules that should always be enforced.

Typical examples include:

  • Financial calculations
  • Data validation
  • Creating linked records
  • Integration with external systems
  • Workflow automation

Critical business logic should always reside on the server rather than in client-side scripts.

7. Reports and Print Formats 

Each DocType can include:

  • Custom reports
  • Printable documents
  • PDF templates
  • Dashboards
  • Charts
  • Analytics

This allows business users to work with the same data in multiple formats without duplicating information.

Types of DocTypes

Not every DocType serves the same purpose. Frappe provides several different types depending on your requirements.

1. Standard DocTypes

These are the built-in DocTypes provided by ERPNext.

Examples include:

  • Sales Invoice
  • Purchase Order
  • Item
  • Customer
  • Employee
  • Supplier

These form the core ERP functionality used across the system.

2. Child Table DocTypes

Child Tables store multiple related records inside a parent DocType.

For example:

  • A Sales Invoice contains multiple invoice items.
  • Instead of storing everything in one table, ERPNext stores line items in a Child Table DocType linked to the parent Sales Invoice.

This keeps data organized and scalable.

3. Single DocTypes

Single DocTypes are used for settings or configuration screens where only one record exists.

Examples include:

  • System Settings
  • Company Settings
  • Website Settings

Instead of creating multiple records, the system updates the same configuration document.

4. Custom DocTypes

Custom DocTypes are created by developers or administrators to allow businesses to model processes unique to their operations.

Examples include:

  • Equipment Inspection
  • Vehicle Maintenance
  • Customer Feedback
  • Site Audit
  • Machine Calibration
  • Compliance Tracking

This is where the flexibility of Frappe becomes especially powerful.

How ERPNext DocTypes Support Customization

Most ERPNext customization projects involve one of two approaches.

Extending Existing DocTypes

This includes:

  • Adding custom fields
  • Creating validation rules
  • Updating permissions
  • Introducing approval workflows
  • Building custom reports
  • Automating business processes

For many organizations, this is sufficient to adapt ERPNext to existing operations.

Creating New DocTypes

Sometimes your business process doesn't exist in ERPNext.

In these cases, developers create entirely new DocTypes and link them to existing ERP modules.

Examples include:

  • Vendor Quality Inspection
  • Asset Verification
  • Medical Examination
  • Factory Compliance Audit
  • Delivery Checklist

Because these additions live outside ERPNext's core code in Frappe's metadata layer, they're typically easier to maintain during future upgrades.

If you're unsure which route fits your business, our detailed comparison of ERPNext customization vs. custom Frappe app development breaks down how to decide between the two.

DocTypes in Developing Custom Frappe Apps

DocTypes become even more important when building a standalone Frappe application, customer portal, vendor portal, hospital management system, school management platform, manufacturing execution system, field service application, property management software.

Instead of extending ERPNext, developers create an entirely new data model tailored to your business.

Every screen, workflow, report, and approval process begins with carefully designed DocTypes.

A well-structured data model leads to:

  • Better performance
  • Easier maintenance
  • Cleaner integrations
  • Greater scalability

Example: Turning a Business Requirement into a DocType

Suppose your organization wants to inspect equipment before approving Purchase Receipts.

Here's how that requirement is translated into a DocType.

Step 1: Identify the Required Information

You need to capture:

  • Inspection Date
  • Inspector
  • Equipment
  • Pass/Fail Status
  • Remarks

Step 2: Create a New DocType

Create a custom DocType named: Quality Inspection

Step 3: Add Relevant Fields

Include fields such as:

  • Date
  • Link to Purchase Receipt
  • Equipment
  • Pass/Fail
  • Notes

Step 4: Configure Permissions

Allow only the Quality team to:

  • Create
  • Edit
  • Approve inspections

Step 5: Add an Approval Workflow

Draft → Submitted → Approved

Step 6: Link with ERPNext

Connect the new DocType to Purchase Receipts so inspections become part of the procurement process.

Within a short development cycle, a business requirement becomes a fully functional, permission-controlled, reportable part of the system, without touching ERPNext's core code. For a realistic sense of how long a project like this takes and what it costs, see our breakdown of ERPNext implementation timeline and cost.

Common Mistakes When Working with DocTypes

Even experienced teams can encounter issues if DocTypes aren't designed thoughtfully.

Some common mistakes include:

  • Making One DocType Too Complex: Trying to handle too many unrelated processes in a single DocType often results in cluttered forms and difficult maintenance.
  • Using Client Scripts for Critical Logic: Business rules should live on the server to ensure they're enforced consistently.
  • Poor Naming Conventions: Inconsistent naming makes records difficult to identify and can create confusion across departments.
  • Weak Permission Planning: Incorrect permissions may expose sensitive business data or allow unauthorized changes.
  • Creating Duplicate Functionality: Building new DocTypes for features already available in ERPNext increases maintenance costs and technical debt.

Good DocType design early in the project saves significant time, effort, and future rework.

Why Understanding DocTypes is Important

You don't need to be a developer to benefit from understanding DocTypes.

Knowing how ERPNext structures data helps you:

  • Scope customization projects more accurately
  • Communicate requirements more effectively
  • Understand project timelines
  • Make better build-versus-customize decisions
  • Reduce unnecessary development costs
  • Collaborate more effectively with implementation partners

Whether you're extending ERPNext or building a custom Frappe application, your business processes ultimately become DocTypes.

Build Better ERPNext Solutions with Well-Designed DocTypes

DocTypes are the foundation of everything built with ERPNext and the Frappe Framework. Every form, workflow, report, dashboard, and business process starts with a well-designed DocType.

For businesses, understanding this concept leads to better implementation decisions, more effective customization requests, and systems that remain maintainable as they grow.

If you're planning an ERPNext implementation, extending existing modules, or developing a custom Frappe application, investing time in designing your DocTypes correctly from the beginning can save countless hours of redevelopment later.

At Softices, we help businesses design scalable ERPNext & Frappe development customizations and applications with well-structured DocTypes that support long-term growth, maintainability, and seamless upgrades.


Django

Previous

Django

Next

ERPNext Implementation Timeline and Cost: What to Realistically Expect

erpnext-implementation-cost-timeline

Frequently Asked Questions (FAQs)

A DocType (Document Type) is the core building block of ERPNext and the Frappe Framework. It defines how data is stored, displayed, validated, and managed, including fields, permissions, workflows, and business logic. Every record in ERPNext, such as a Sales Invoice or Customer, is based on a DocType.

ERPNext supports four main types of DocTypes:
  • Standard DocTypes for built-in ERP modules
  • Custom DocTypes for unique business processes
  • Child Table DocTypes for storing related line items
  • Single DocTypes for configuration and settings where only one record exists.

DocTypes are used to customize ERPNext by adding custom fields, creating new forms, configuring workflows, defining permissions, and automating business processes. They allow businesses to adapt ERPNext to their specific requirements without modifying the core application.

Yes. ERPNext allows you to create and extend DocTypes through the Frappe Framework's metadata layer. This approach keeps most customizations upgrade-friendly and makes it easier to maintain your ERP system when new ERPNext versions are released.

A Standard DocType is included with ERPNext by default and supports core business functions such as accounting, inventory, HR, and CRM. A Custom DocType is created to manage business processes that are unique to your organization, such as equipment inspections, compliance tracking, or industry-specific workflows.