Create a DocType ​

Create a DocType when you need to store data that no ERPNext form covers, for example vehicle records, site inspections, or an employee transfer request. To add a few fields to an existing form, add a custom field instead.

Prerequisites ​

  • The System Manager role.
  • A plan of the fields that the document needs.

Create the DocType ​

  1. Open the DocType list, and select New.
  2. Enter the name, for example Vehicle Inspection.
  3. In Module, select the module that the DocType belongs to.
  4. Add the fields in the form builder. For each field, set the label, the type, and the options. Read the field types reference.
  5. Set the naming rule, the form settings, and the permissions, as described below.
  6. Select Save.

ERPNext creates the database table, the form, and the list. Open the list from the search bar.

Naming ​

In Naming Rule, select how each new document gets its ID:

Naming RuleID
Set by userThe user types the ID.
AutoincrementA number that goes up by one.
By fieldnameThe value of a field, for example the vehicle number.
By "Naming Series" fieldA series that the user selects in a Naming Series field, such as VI-.YYYY.-.#####. Read Set up naming series.
ExpressionA pattern with field values. Enter it in Auto Name, for example VI-.vehicle.-.#####, which gives VI-KA01AB1234-00001.
Random or UUIDA random ID.

Form settings ​

SettingWhat it does
Is SubmittableDocuments go from draft to submitted to cancelled.
Is Child TableThe DocType is a table inside other documents.
Is SingleOnly one document exists, as for a settings page.
Is TreeDocuments form a tree of groups and children.
Quick EntryOpens a short pop-up with the mandatory fields when you create a document from another form.
Track ChangesKeeps the version history of every document. Read Track changes to a document.
Track SeenRecords which users have seen each document.
Track ViewsRecords each time a user opens a document.
Allow RenameLets users rename documents.
Has Web ViewLets website users see the documents on the website.

The View Settings hold the Title Field, the Search Fields, and the Default Sort Order of the list.

Permissions ​

In the Permission Rules table, add one row for each role that uses the DocType. Select what the role can do, such as Read, Write, Create, Submit, and Cancel. Read Role Based Permissions.