Add a link field and filter its options ​

A Link field points to a document of another DocType. For example, the Customer field of a Sales Order links to the Customer master. The user selects a customer from a dropdown, and can open it from the field.

Prerequisites ​

  • The System Manager role.
  1. Open Customize Form for the DocType, for example Quotation.
  2. Add a field where you want it.
  3. Enter the Label, for example Project.
  4. Set the field type to Link.
  5. In Options, enter the DocType to link to, for example Project.
  6. Select Update.

You can limit the documents that a link field offers. For example, a Company field can offer only some companies.

  1. In Customize Form, open the link field in the form builder.
  2. Select the filter icon of the field.
  3. Add the filters, and select Apply.
  4. Select Update.

To go back to the standard filters, select Reset To Default. Filters that you set in Customize Form replace the standard filters of the field.

Filter on a value of the form ​

A filter value can come from another field of the form. Write it as eval: and an expression:

  • eval: doc.company uses the value of the Company field.
  • eval: doc.fieldname1 + doc.fieldname2 combines two fields.

In a child table, you can use two kinds of values:

  • doc.<field name>: a field of the same row.
  • parent.<field name>: a field of the parent document.

INFO

A filter that a client script sets with frm.set_query takes priority over a filter that you set in the UI.