From 7a51007ce604209493be9ac3e07d2609b15235f7 Mon Sep 17 00:00:00 2001 From: Tropicalrambler Date: Fri, 24 Nov 2017 21:37:26 -0600 Subject: [PATCH] added an important note to guarantee functionality when fetching values from other DocTypes: --- Community-Developed-Custom-Scripts.md | 2 ++ 1 file changed, 2 insertions(+) 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]", {