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
- Open the DocType list, and select New.
- Enter the name, for example
Vehicle Inspection. - In Module, select the module that the DocType belongs to.
- Add the fields in the form builder. For each field, set the label, the type, and the options. Read the field types reference.
- Set the naming rule, the form settings, and the permissions, as described below.
- 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 Rule | ID |
|---|---|
| Set by user | The user types the ID. |
| Autoincrement | A number that goes up by one. |
| By fieldname | The value of a field, for example the vehicle number. |
| By "Naming Series" field | A series that the user selects in a Naming Series field, such as VI-.YYYY.-.#####. Read Set up naming series. |
| Expression | A pattern with field values. Enter it in Auto Name, for example VI-.vehicle.-.#####, which gives VI-KA01AB1234-00001. |
| Random or UUID | A random ID. |
Form settings
| Setting | What it does |
|---|---|
| Is Submittable | Documents go from draft to submitted to cancelled. |
| Is Child Table | The DocType is a table inside other documents. |
| Is Single | Only one document exists, as for a settings page. |
| Is Tree | Documents form a tree of groups and children. |
| Quick Entry | Opens a short pop-up with the mandatory fields when you create a document from another form. |
| Track Changes | Keeps the version history of every document. Read Track changes to a document. |
| Track Seen | Records which users have seen each document. |
| Track Views | Records each time a user opens a document. |
| Allow Rename | Lets users rename documents. |
| Has Web View | Lets 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.