brotherton-erpnext/erpnext/docs/user/manual/en/customize-erpnext/custom-field.md

75 lines
3.9 KiB
Markdown
Raw Normal View History

2017-07-31 10:50:43 +00:00
# Custom Field
2016-03-14 13:58:06 +00:00
Every form in the ERPNext has standard set of fields. If you need to capture some information, but there is no standard field available for it, you can insert Custom Field in a form as per your requirement.
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
Following are the steps to insert Custom Field in the existing form.
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
####Customize Form
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
To add a Custom Field, go to:
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
`Setup > Customize > Customize Form`
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
####Select Document Type
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
In the Customize Form, select Document Type in which you want to insert Custom Field. Let's assume we are inserting Custom Field in the Employee master.
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
<img alt="Select Document Type" class="screenshot" src="{{docs_base_url}}/assets/img/customize/custom-field-1.gif">
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
#### Insert Row for the Custom Field
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
In Customize Form, open the field above which you want to insert a Custom Field. Click on Insert Above.
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
<img alt="Select Document Type" class="screenshot" src="{{docs_base_url}}/assets/img/customize/custom-field-2.gif">
2015-11-05 11:25:10 +00:00
####Set Field Label
Custom Field's name will be set based on its Label. If you want to create Custom Field with specific name, but with different label, then you should first set Label as you want Field Name to be set. After Custom Field is saved, you can edit the Field Label again.
2016-03-14 13:58:06 +00:00
<img alt="Select Document Type" class="screenshot" src="{{docs_base_url}}/assets/img/customize/custom-field-3.png">
2015-11-05 11:25:10 +00:00
####Select Field Type
2016-03-14 13:58:06 +00:00
There are various types of Field like Data, Date, Link, Select, Text and so on. Select Field Type for the Custom Field.
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
<img alt="Select Document Type" class="screenshot" src="{{docs_base_url}}/assets/img/customize/custom-field-4.png">
Click [here]({{docs_base_url}}/user/manual/en/customize-erpnext/articles/field-types.html) to learn more about types of field you can set for your Custom Field.
2015-11-05 11:25:10 +00:00
####Set Option
2016-03-14 13:58:06 +00:00
Based on the Field Type, value will be entered in the Options field.
2015-11-05 11:25:10 +00:00
2016-03-14 13:58:06 +00:00
If you are creating a Link field, then in the Options, enter Doctype name with which this field will be linked. Click [here]({{docs_base_url}}/user/manual/en/customize-erpnext/articles/creating-custom-link-field.html) to learn more about creating custom link field.
2015-11-05 11:25:10 +00:00
If field type is set as Select (drop down field), then all he possible result for this field should be listed in the Options field. Each possible result should be separate by row.
2016-03-14 13:58:06 +00:00
<img alt="Select Document Type" class="screenshot" src="{{docs_base_url}}/assets/img/customize/custom-field-5.png">
2015-11-05 11:25:10 +00:00
For Data field, Option can be set to "Email" or "Phone" and the field will be validated accordingly.
For other field types like Date, Currency, Option field will be left blank.
2015-11-05 11:25:10 +00:00
####Set More Properties
You can set properties as:
2016-03-14 13:58:06 +00:00
1. Mandatory: If checked, entering data in the custom field will be mandatory.
1. Print Hide: If checked, this field will be hidden from the Standard Print Format. To make field visible in the Standard Print Format, uncheck this field.
2015-11-05 11:25:10 +00:00
1. Field Description: It will be short field description which will appear just below that field.
2016-03-14 13:58:06 +00:00
1. Default Value: Value entered in this field will be auto-set in the Custom Field.
2015-11-05 11:25:10 +00:00
1. Read Only: Checking this option will make custom field non-editable.
1. Allow on Submit: Checking this option will allow editing value in the field when in submitted transaction.
2016-03-14 13:58:06 +00:00
####Update Customize Form
After inserting required details for the Custom Field, Update Customize Form. On update, Custom Field will be inserting in the form, Employee master in this case. Before checking Employee form, reload your ERPNext account. After reload, check Employee form to see Custom Field in a form.
<img alt="Select Document Type" class="screenshot" src="{{docs_base_url}}/assets/img/customize/custom-field-6.png">
2015-11-05 11:25:10 +00:00
####Deleting Custom Field
2016-03-14 13:58:06 +00:00
Given a permission, user will be able to delete Custom Fields. Incase Custom Field is deleted by mistake, if you add another Custom Field with same name. Then you shall see new field auto-mapped with old-deleted Custom Field.
2015-11-05 11:25:10 +00:00
{next}