What's the difference between Customize Form vs Custom Doctype

Hi Everyone

We are in the midst of creating a new module here, and creating new forms/doctype is essential.

What I don’t understand is why creating a new doctype/form through different entry points would leave me with more/less options during the Form customization process.

Example :

Could someone please explain to me why the creation of new Doctype from different entry points will have a different access to customization options? What’s the rationale behind this usage design?

A Custom Doctype (eg. a new doctype) is typically used when you want to create an entirely new doctype for a new or existing Module. This is usually used when:

  1. You’re developing a new feature which needs a form/doctype in an existing module/app
  2. You’re developing a new app/module and new doctypes along with it.

Customize Form, Custom Fields, and custom scripts are used when you’re just adding features on an existing doctype that you/your organization did not create. Typically, this is what you do when you want to add fields to an ERPNext Doctype that already exists.

Edit:

creating a new module here

You can just stick to new doctypes. No need to use custom fields/customize form (unless if you’re planning on modifying ERPNext doctypes).

You can also change the form by adding/removing fields in the DocType form. Add your server-side code in the auto-generated python file and your client-side code in the .js file.

Hope this helps. :slight_smile:

10 Likes

I Kind of get it now, the customization options that occur out of creating doctype from Customize Form only appear briefly , it will be moved to the bottom once the doctype is saved and reopened from the DocType list

Hi,

What does the custom check mean in doctype ?

Any DocType which you create manually other than the ones offered by ERPNext as default, are marked as Custom DocTypes.

You are able to check/uncheck it because I assume you are in developer mode, to others it is a read-only field.

This is a good question, and Frappe/ERPNext could certainly stand some clearer explanation about how the terms “Custom” and “Standard” get applied in various locations.

The difference between a Custom and a non-Custom doctype has to do with how the doctypes are represented in your server and the extent of customization you can apply. In very short order, custom doctypes become part of the site you’re using, and non-custom doctypes become part of an app.

Custom Doctype Non-custom Doctype
Developer Mode required: no yes
Part of an app: no yes
Part of site backups: yes no
Field definition location: database json file
Uses python controller: no yes

In short, if you want your doctype to be specific to your current Frappe/ERPNext site, check “Custom”. If you’re developing a doctype for distribution in an app, leave Custom unchecked.

13 Likes

Is it customary to check Custom? checkbox when creating DocType in a custom app?

Did you see the table in the post immediately above your post? If you click “Custom?” the doctype will not be part of your app’s source code.

Hi @peterg, thanks for that table - very helpful!
Just one question for clarification: “Part of site backups” → Will this mean the DocType definition itself is not part of the backup, if we are in the “non-custom” scenario? As far as I understand, the data itself will be stored at any time in the database (and backuped).

Indeed, and thanks for the clarification. As I understand it, the data will be backed up no matter what. The doctype definition, however, is only backed up for custom doctypes. For non-custom doctypes, the doctype definition is part of the app itself and so the app will need to be installed to use it on a new site.

Hi, when I use customize form or Custom fields to add a feature on an existing ERPnext doctype how can I make sure I track the changes within git?

This should be added to the documentation, thank you.

The custom button is greyed out and doctype directory is not created as well, i am in developer mode:1, and logged in as administrator, what should be done in this senario

1 Like

Hey guys! My question for this would be (maye @peterg you will know), in which table are customisations stored? Thx!

Hi @mvarchdev:

Customizations are stored on different doctypes:

  • Doctype :crazy_face: (in case you added it)
  • Custom field (new custom fields on existing doctypes)
  • Property setter (custom properties of doctype/docfield)

Hope this helps.

2 Likes