frappe-impl-clientscripts

Implement Frappe client scripts for form events, field dependencies, and server calls.

163|53|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-clientscripts-impertio-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-impl-clientscripts
Source: https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/impl/frappe-impl-clientscripts
Command: npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-clientscripts-impertio-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you implement Frappe/ERPNext client-side form logic that behaves correctly across form load, user interactions, and child-table updates, preventing subtle UI bugs and production failures caused by incorrect event usage or missing refresh patterns.

Core Features & Use Cases

  • Event-driven client script workflows: Step-by-step guidance for choosing the correct client script event (setup, refresh, validate, field handlers, child table events) to match the desired behavior and timing.
  • Field dependencies and UI rules: Clear instructions for implementing show/hide, required toggling, cascading link filters, and computed totals with the correct event combinations.
  • Server-call integration from the browser: Practical patterns for deciding between frappe.db.get_value, frm.call, frappe.call, and frappe.xcall and using async/await safely during validation.
  • Custom button and debugging patterns: Rules for adding buttons in refresh with correct guards, plus concrete browser debugging steps using DevTools and handler inspection.
  • Migration to a custom app: How to move a Client Script document into version-controlled assets using hooks and public JS files.

Use case example: You need a Sales Order UI where delivery_date appears only when requires_delivery is checked, city options depend on country, and invoice totals update live when child rows change; this Skill provides the exact event strategy and code structure to make it robust.

Quick Start

Implement a Frappe client script for DocType Sales Order that toggles the delivery_date field based on requires_delivery and recalculates totals from the child table, including the correct refresh plus field handlers, server-call validation pattern, and migration steps to a custom app.

Frequently Asked Questions about frappe-impl-clientscripts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Which Frappe client script event should I use to toggle field visibility on form load?

Use the refresh event to toggle field visibility on initial load and updates, combined with field handlers for interactive changes. This ensures UI rules stay consistent across the entire form lifecycle.

How do I calculate child table totals live in an ERPNext client script?

To calculate child table totals live, bind child table events to recalculate values on row changes and use the refresh event to initialize sums. This prevents stale totals during user interactions.

What is the difference between frappe.call and frm.call for server validation in client scripts?

Use frm.call for document-specific server methods and frappe.call or frappe.xcall for generic endpoints. The skill provides safe async/await patterns to run these server calls during validation without blocking.

How do I move a Frappe Client Script into a custom app?

To migrate a Client Script into a custom app, move the logic into version-controlled public JS files and register them using hooks. This transitions UI rules from database documents to code assets.

Why does my custom button disappear after refreshing a Frappe form?

Custom buttons disappear without correct refresh guards that check if the button already exists before adding it. Add conditional checks inside the refresh event to prevent duplicate or vanishing buttons during updates.

How do I set up cascading link filters for a field in Frappe?

Set up cascading link filters by applying set_query inside form events to restrict child options based on parent values. This ensures dependent dropdowns update correctly during user interaction and form load.