Created
February 17, 2015 07:13
-
-
Save rmehta/13f20e4ec24061d2e5f8 to your computer and use it in GitHub Desktop.
Frappe Version 5 Client Side API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// button click "Get Items" | |
frappe.ui.form.on("Stock Reconciliation", "get_items", function(frm) { | |
// prompt user for warehouse | |
frappe.prompt({label:"Warehouse", fieldtype:"Link", options:"Warehouse", reqd: 1}, | |
function(data) { | |
// get latest balance and valuation rate | |
frappe.call({ | |
method:"erpnext.stock.doctype.stock_reconciliation.stock_reconciliation.get_items", | |
args: {warehouse: data.warehouse}, | |
callback: function(r) { | |
// set the values in the item table | |
var items = []; | |
frm.clear_table("items"); | |
for(var i=0; i< r.message.length; i++) { | |
var d = frm.add_child("items"); | |
$.extend(d, r.message[i]); | |
} | |
frm.refresh_field("items"); | |
} | |
}); | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment