- Home
- Skills
- Venkateshvenki404224
- Frappe Apps Manager
- Frappe Client Script Generator
frappe-client-script-generator_skill
7
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill venkateshvenki404224/frappe-apps-manager --skill frappe-client-script-generator- SKILL.md17.2 KB
Overview
This skill generates production-ready JavaScript client scripts for Frappe/ERPNext DocTypes, producing event handlers, validations, and UI customizations that follow core app patterns. It speeds up building refresh/setup/onload handlers, field change logic, child table events, custom buttons, API calls, validations, and conditional displays.
How this skill works
Provide the DocType name, target fields, desired events (refresh, setup, onload, validate, before_submit, field changes, child table events) and any business rules. The skill produces idiomatic frappe.ui.form.on code blocks with set_query filters, frappe.db/get_value and frappe.call patterns, custom buttons, dialogs, and calculations that you can drop into client-side scripts. It uses common patterns (toggle_display, set_df_property, frm.events helper functions, model.set_value) to ensure maintainability and compatibility.
When to use it
- Add custom client-side behavior to a DocType form (show/hide, read-only, labels).
- Implement field validations and before-save checks in the browser.
- Compute totals or update child table values on qty/rate changes.
- Add custom buttons or dialog-driven actions in the form toolbar.
- Filter Link fields dynamically using set_query or complex query functions.
Best practices
- Define reusable frm.events helper functions for shared logic across handlers.
- Use setup for set_query and one-time initialization, onload for defaults, refresh for buttons and UI toggles.
- Prefer frappe.db.get_value and frappe.call with promises/callbacks for server data; sync only when necessary.
- Keep heavy processing on the server; client scripts should validate and prepare data.
- Use frm.toggle_display and frm.toggle_reqd for conditional UI instead of manipulating DOM directly.
Example use cases
- Auto-fill customer_group when customer is selected using frappe.db.get_value.
- Calculate child table amounts and grand total when qty or rate change.
- Add a toolbar button that maps related documents into the current form.
- Show/hide payment fields based on payment_type and set required flags.
- Filter item link field in a child table to only show items from certain item groups.
FAQ
Yes. The skill produces frappe.call examples to invoke server methods and handle callbacks or promise responses.
Where should I place the generated script?
Put it in a client script for the DocType (public/js or the Client Script doctype) so Frappe loads it on form render.