I am facing an issue with the fetch_from functionality in a child table and need guidance.
Scenario:
-
I also added a
custom_po_nofield in the Production Plan Sales Order child table of the Production Plan doctype. -
I configured the child table field with
fetch_from = sales_order.po_no.
Issue:
When I use the “Get Sales Orders” button in the Production Plan form:
-
The Sales Orders are populated correctly into the child table.
-
However, the
fetch_fromdoes not work for thepo_nofield. -
The value is not fetched when the Production Plan form is unsaved.
-
The value only appears after saving the document (or sometimes not at all).
Requirement:
I want to manually trigger the fetch_from behavior using JavaScript so that:
-
When Sales Orders are added via the button,
-
The related fields (like
po_no) are immediately fetched into the child table rows, -
Even when the Production Plan form is not yet saved.
Can someone please suggest:
-
The correct Client Script approach to manually fetch linked field values in a child table?
-
Or the recommended way to trigger
fetch_fromlogic programmatically?