Hi all,
I’m working on a Frappe app for managing PF Applications. Here’s my scenario:
-
I have a workflow for PF Applications with standard states: Draft → Submitted → Approved → Rejected.
-
I want to keep the standard workflow buttons (e.g., the “Approve” button) and not replace them with custom buttons.
-
When a user clicks Approve, I want a popup dialog to appear before finalizing the approval, where the user can fill in additional fields like
UI NumberandNumber ID. -
Currently, Frappe workflows allow Update Field → approve = 1 when a workflow transition occurs. My idea was to depend on a checkbox field updated by the workflow and trigger the popup client-side based on that field.
Problem:
-
Field triggers (
approve: function(frm){}) do not fire when the workflow updates the field server-side. -
MutationObservers or DOM hacks fail because workflow buttons are handled internally by Frappe’s JS.
-
Server-side hooks (
before_workflow_action,on_update) work for automatic field updates, emails, or logs, but cannot show client-side popups.
Concept / Requirement:
-
Workflow button must stay as-is.
-
Popup must appear client-side when the workflow approves, allowing users to input required fields.
-
Workflow must proceed normally after the popup.
-
Prefer a solution that combines workflow automation with optional popup input.
I’d love advice on:
-
Best practices for integrating client-side popups with Frappe workflow buttons.
-
Whether relying on a checkbox field updated by workflow is the most reliable approach.
-
Any alternative patterns that let me keep workflow buttons while capturing user input before approval.
Thanks in advance for your guidance!