diff --git a/Community-Developed-Custom-Scripts.md b/Community-Developed-Custom-Scripts.md index 368646f..70e4fde 100644 --- a/Community-Developed-Custom-Scripts.md +++ b/Community-Developed-Custom-Scripts.md @@ -103,6 +103,8 @@ frappe.ui.form.on("DocTypeB", "Trigger", function(frm) { *** ### Fetch fields from another DocType into a child table This script takes data from another DocType source field and copies it onto a target field within the Child table in the current form or document (when you are editing it or on refresh). This is useful for pulling custom fields in Item DocType unto Sales Invoice Item, Purchase Receipt Item, etc. +**Important**: Make sure that the field Types as defined in the Customize Form or Custom Field, match for both the Source and the Target DocTypes! + ``` frappe.ui.form.on("[PARENT_DOCTYPE_TARGET]", "refresh", function(frm) { frappe.ui.form.on("[CHILD_TABLE_TARGET_DOCTYPE]", {