Hello guys.
i am trying to fetch value of “qty_after_transaction” from “tabStock Ledger Entry” table in custom script. But is there any possibility to get that value with the help of custom script. Because i searched andf found following method
frappe.db.get_single_value(doctype, field)
in which it is clearly mentioned that i should pass doctype name as parameter and there is no doctype named “Stock Ledger Entry”. Stock Ledger Entry is actually form.
frappe.ui.form.on(‘Batch’, {
refresh(frm) {
// your code here
var stockQty=frappe.db.get_single_value(“Stock Ledger Entry”, “qty_after_transaction”)
//var a=21;
i tried but no luck got error…can you clarify me that. Can we fetch value of fields from Forms(not doctype)?
My scenario is:
i have to fetch the “Actual qty” from “stock ledger entry” (that is not a doctype) to batch doctype, and set that value in the field inside the same doctype called batch.
I want to fetch a value from the database using certain conditions and put it in a field.
I have a field “A” in Customer. After performing query with conditions on the database I get a value. How do I insert that value achieved from the query into the field “A”.