to select ↑↓ to navigate
iVendNext

iVendNext

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

Fetch value in a child table field from Master

Sample Script to fetch expiry_date field from Batch doctype to Sales Invoice Item table

Step 1: Create Custom Script for _Sales Invoice_ (parent) doctype

Step 2: Script as below & Save


ivendNext.ui.form.on("Sales Invoice Item", "batch_no", function(frm, cdt, cdn) {
 var d = locals[cdt][cdn];
 ivendNext.db.get_value("Batch", {"name": d.batch_no}, "expiry_date", function(value) {
 d.expiry_date = value.expiry_date;
 });
});
Last updated 2 months ago
Was this helpful?
Thanks!