Skip to main content

FORM & VIEW SETTINGS — Frappe Framework v15

A complete, technically accurate, SEO-ready documentation page for goerpnext.com

Introduction & Context

Form & View Settings in Frappe Framework v15 determine how users interact with data inside the Desk interface. These settings govern how DocTypes appear in the Form View, List View, and other related UI components. Frappe provides a flexible configuration layer that enables developers and functional consultants to define how data is shown, validated, grouped, ordered, or interacted with.

Both settings are essential because:

  • Form Settings affect how an individual record opens and displays fields
  • View Settings (List View) govern how multiple records are displayed in tables
  • Together, they define the full user experience for every DocType

This guide explains both settings using verified information from Frappe Framework v15 GitHub source code.

What Are Form & View Settings in Frappe v15?

Form Settings define:

  • Field layout
  • Field properties
  • Read-only or hidden fields for certain roles
  • Quick entry behavior
  • Section & column breaks
  • Tabs
  • Form scripts & actions

View Settings define:

  • Columns visible in List View
  • Filters
  • Sorting
  • List indicators (colors)
  • List view layout type (List / Report / Kanban / Dashboard / Calendar)

These settings allow you to shape the UX without altering backend logic.

Form Settings in Frappe v15

What is Form View in Frappe?

The Form View is the primary interface users interact with to create, edit, or view a DocType record. Every DocType has a form.json and docfield definitions that determine how data appears.

Key Form Settings (Frappe v15)

1. Field Layout Management

Field layout is controlled using these DocField types:

UI Element Fieldtype
Section Break Section Break
Column Break Column Break
Tab Break Tab Break
Tab Section Break Tab Section Break

Purpose: Create structured, user-friendly form layouts.

2. Field Properties

Each field in a DocType has configurable properties:

Property Description
Label Visible field name
Fieldtype Data type (Data, Select, Link, Table, etc.)
Read Only Makes field non-editable
Hidden Removes field from UI
Mandatory Requires value before saving
Default Sets default value

These settings exist inside:

frappe/desk/form/load.py
doctype/DocField/DocField.json

3. Permissions & Role-Based Field Visibility

Fields can be hidden or read-only based on role permissions.

  • Controlled through Role Permissions Manager
  • Dynamically extended through Client Scripts

Example (Frappe v15 client script):

frappe.ui.form.on("Sales Invoice", {
refresh(frm) {
if (!frm.doc.customer) {
frm.set_df_property("due_date", "read_only", 1);
}
}
});

4. Form Scripts & Event Hooks

Scripts affect:

  • Field behaviors
  • Auto-fetch
  • Validation
  • Button actions

Relevant events in v15:

    • validate
    • before_save
    • after_save
    • on_submit
    • on_cancel
    • refresh

5. Quick Entry Form Settings

DocTypes support Quick Entry using:

quick_entry: 1

Found in:

frappe/desk/form/quick_entry.py

View Settings in Frappe v15

What is List View in Frappe?

List View is where users see tables of documents. It is defined using List View Settings and optionally overridden using custom scripts.

Key List View Settings (Frappe v15)

1. List View Metadata in DocType

A DocType defines its list view behavior using:

show_name_in_global_search
show_preview_popup
in_list_view
in_standard_filter

2. Configurable List Columns

For each DocField:

  • in_list_view: show this column
  • bold: highlight it
  • in_standard_filter: allow global filtering

3. List View Script Overrides

You can customize:

  • Indicators
  • Row data
  • Formatting
  • Stats

Example (v15 listview.js):

frappe.listview_settings['ToDo'] = {
get_indicator(doc) {
if (doc.status === "Open") {
return ["Open", "red", "status,=,Open"];
}
return ["Closed", "green", "status,=,Closed"];
}
}

4. Filter & Sorting Configuration

Users can:

  • Add custom filters
  • Save views
  • Set default filters (via default_filters in list view settings)

The backend is handled in:

frappe/desk/reportview.py
frappe/model/db_query.py

Configuration & Setup

To Configure Form Settings

Go to:

Desk → DocType → Open Any DocType → Fields Table

Modify:

  • Field order
  • Section breaks
  • Mandatory settings
  • Visibility

To Configure List View:

In Customize Form:

  • Enable “In List View” for fields
  • Enable “In Standard Filter”
  • Set “Bold” for primary identifier fields

Best Practices & Tips (Frappe v15)

  • Keep list view columns limited (max 5)
  • Use Section Breaks to group related fields
  • Use Column Breaks to balance layout
  • Avoid too many mandatory fields
  • Use Client Scripts instead of core customization
  • Use indicator color codes consistently

Troubleshooting

Issue Cause Solution
Fields not showing in list view in_list_view disabled Enable from Customize Form
List view not updating Cached metadata Run bench clear-cache
Form layout broken Misplaced section/column breaks Rearrange or remove breaks
Scripts not running Wrong event name Verify v15 event list

Cross-References

Conclusion

Form & View Settings in Frappe Framework v15 give developers and implementers powerful control over how users interact with data. By configuring field visibility, layout structure, list view columns, and form behavior scripts, you can create intuitive, robust, industry-ready user experiences without modifying core code.

Click to rate this post!
[Total: 0 Average: 0]