Custom Field

Every form in ERPNext has a standard Custom Field that comes with it. But not all businesses have the same needs, so you may need to look for more information that isn’t given by default. Custom Fields let you add to standard and custom DocTypes without changing the core code in these situations.

 

Custom Fields in ERPNext v16 make it easy and safe to change forms to fit the needs of your business. People often use them to keep track of extra attributes, custom reports, workflows, internal references, and regulatory data.

 

You can use the built-in customization tools to add a Custom Field to any Form or Document Type (DocType).

 

Custom Field

 

 

To get to Custom Field, follow these steps:

 

Home > Customization > Form Customization > Custom Field

 

You can also change the fields for a DocType by going to its List View and clicking “Customize” in the menu.

 

 

How to make a field that is just for you

To add a new Custom Field, follow these steps:

 

1. In the list of Custom Fields, click New.

2. Choose the Document field that has the DocType you want to add the Custom Field to. This tells you where the field will be and which records will keep its value.

3. Fill in the Label, which is the name that will appear on the form. This label tells ERPNext what to call the internal field.

4. Pick the kind of field. There are many types of fields in ERPNext, such as Data, Select, Link, Date, Check, Currency, Table, and more. The kind of field you pick changes how it works, how it saves data, and how scripts, filters, and reports can use it.

5. Click Update (or Save) to use the Custom Field on the chosen DocType.

 

 

You can use the field right away after you save the form, and you can use it anywhere in the system.

 

Here are some of the most important options for a Custom Field:

 

 

With Customize Form, you can also add, change, move, or delete fields in a certain form.

 

 

 

With Customize Form, you can do these things:

 

 

More information about ERPNext v16:

 

1.1. More Details

You have more control over how a Custom Field works, looks, and interacts with other fields and documents in ERPNext v16. These choices help keep the data consistent, improve the user experience, and make sure that business standards are met.

 

1. Options: If the Field Type you chose has a list of choices already set up, use this field to set the values that are allowed.

 

Options are most often used in ERPNext v16 for:

 

 

You can set values like these if the Field Type is Select:

 

 

 

 

This makes sure that users can only choose from the set values, which keeps the data correct and consistent.

 

2. Fetch From: The Fetch From feature lets you automatically pull data from a linked document into the Custom Field.

 

This choice is often used with Link fields and looks like this:

 

 

For instance: If you create a Custom Field Project in the Item DocType,

 

 

This makes sure that the linked page automatically puts the right information in the Custom Field.

 

3. Fetch If Empty: If this box is checked, the system will only get data if the field is empty.

 

 

For instance: If a fetched value is automatically filled in when a new item is made but then changed by a user, turning on “Fetch If Empty” will stop future automated updates from replacing what the user entered.

 

4. Default Value: When you make a new document, the Default Value is the value that is set automatically.

 

In ERPNext v16, these are the default values:

 

 

Default values make it less likely that you will have to type in information by hand and make sure that all records are the same.

 

5. Depends On: The Depends On property determines whether or not the Custom Field is displayed based on certain conditions.

 

You can use the following to make rules:

 

 

 

The “Asset Category” and “Asset Naming Series” fields will only be visible in the Item DocType if you choose “Is Fixed Asset.”
The need for reliance would be:

 

is a permanent asset

 

This makes forms easier to read by only showing fields when they are needed.

 

6. Field Description: You can type a description of this field here. It will be below the Custom Field on the form.

 

Field descriptions are useful for:

 

 

 

 

In ERPNext v16, anyone who can see the field can also see the descriptions that have been written.

 

7. Permission Level: You can set the Permission Level to choose who can see or change the Custom Field.

 

 

For instance: You could let regular users see a field but not let Managers or System Managers change it. People often use this to send private or approval-related messages.

 

8. In Preview: Popup for the DocType is on, checking In Preview adds this Custom Field to the hover preview popup.

 

This pop-up appears:

 

 

Adding important fields to the preview makes it easier to find your way around and means you don’t have to open whole documents as often.

 

9. Width: The Width property tells the Grid View (child table) how much space the Custom Field takes up when it is shown.

 

 

Custom Fields in ERPNext v16 work almost exactly like regular fields now that they have these new features. This lets you make big changes without putting the system in danger.

1.2. More options

The following features will help you learn more about how to view, check, and use a Custom Field in ERPNext v16. These settings let you choose how the system enters, displays, searches for, prints, and protects data.

 

Required Field: If this field needs to have a value in it before the document can be saved or sent, turn this on. In ERPNext v16, validation that has to happen works on the server and the UI. This means that even when updates happen in the background or through the API, the data stays safe.

 

When this option is turned on, ERPNext makes sure that each document of the DocType has a different value for this field. People often use this for fields that need reference codes, compliance information, or ID numbers.

 

For instance:

 

 

If you enter a value that is already in the system, you won’t be able to save. It will show an error in the validation.

 

Just Read:

 

This means that users can’t change the field. Most of the time, the value is put in by:

 

 

Read-only fields are usually used to show information that has been derived or referenced and shouldn’t be changed by hand.

 

Hidden: When this option is on, the field does not show up at all in the form UI.

 

Here are some common ways to use it:

 

 

If they have the right permissions, scripts, reports, and filters can still use hidden fields.

 

Print Hide: This option makes the field invisible in Print Formats.

 

Use this when:

 

 

If you check this box, the value of this field won’t be copied when you use the Duplicate or Amend tool to make a copy of a document.

 

This is useful for:

 

 

Allow on Submit: This lets people change the field even after they have sent the document.

 

People often choose this option in ERPNext v16 for:

 

 

Editing Value in Submitted Document has safety tips and best practices.

 

If you check this box in List View, the field will show up as a column in the List View of the DocType. This makes it easy to find important information and lets you quickly look through records without having to open each one.

 

 

This is very useful for:

 

 

The search could take longer if you let too many fields be searched all over the world.

 

Bold: This makes the value in the field stand out on the form. This is basically a way to make important or necessary information stand out more visually.

 

Hide Report: If this box is checked, the field won’t show up in Report Builder or in any regular reports.

 

This is useful for:

 

 

This option could make the system open to cross-site scripting (XSS), so be careful when you use it. Only use it with inputs or content sources that you trust and can control. You can use the field label and values for Custom Translations if you turn this option on.

 

This is very helpful for:

 

1.3 Name of the area

When you add a new Custom Field to ERPNext, the name of the field will automatically start with “custom_” (for example, “custom_project_code”).

 

This way of naming things makes it impossible for things to get mixed up with:

 

 

 

 

If you need a certain field name for your customization (for example, to make it work with older versions or other systems), you can change the name of an existing Custom Field.

 

 

Here are some things to keep in mind:

 

Visit Us Here

Zikpro LLP
Talk to our consultant
×
Hello! How can I help you?
Discuss ERPNext