What problem does it solve?
Client-side Frappe code often looks correct but breaks in real forms because it uses the wrong APIs, registers events in the wrong lifecycle hooks, or mishandles child tables and server calls. This Skill helps you write correct, maintainable client scripts that behave reliably across form states in ERPNext/Frappe.
Core Features & Use Cases
- Correct form event lifecycle usage: Registers handlers using the right events like
setup, refresh, validate, and onload_post_render, with an explicit decision tree.
- Safe value manipulation patterns: Uses
frm.set_value() and read-only frm.doc access instead of direct assignments that bypass dirty flags and change triggers.
- Reliable child table updates: Ensures child table modifications are followed by
frm.refresh_field() and uses child-doctype event context with cdt/cdn.
- Link field filtering done right: Places
frm.set_query() in setup so filters are registered once and remain consistent.
- Hardened server communication: Shows how to call whitelisted methods via
frappe.call() and document controller methods via frm.call(), with guardrails like checking r.message.
Quick Start
Write a client script for the Sales Order form that updates an item's amount when qty or rate changes, filters customers by disabled status, and prevents saving with frappe.throw() when a custom validation fails.