sheno
1
Dears
i added a new custom field in quotation item
and added this script from custom script Quotation Item
now it suppose when i selct an item and its quoantity it suppuse to gets a value in the filed Full price
But actually i didnt get any value in it
Hint
i followed that post
Calculate a value for custom field - #3 by Roy_Stephen
sheno
2
any help?
i need to know how can i deal with child table
Hi
or you can try
frappe.ui.form.on("Quotation Item", "full_price", function(frm, doctype, name){
var row = locals[doctype][name]
frm.set_value("full_price", row.qty * row.price_list_rate);
})
1 Like
sheno
4
thanks vinhnguyent090
for your help i tried it .
it didnt work also
sheno
5
even i made a custom filed named full_price
and i tried another code But also didnt work .
By the way i added those in custome scrept menue and i choose Quotation Item
should i choose Quotation Or Quotation Item ?
frappe.ui.form.on(“Quotation Item”, “qty”, function(frm, cdt, cdn) {
var d = locals[cdt][cdn];
frappe.model.set_value(cdt, cdn, “full_price”, d.qty * d.price_list_rate); > });
frappe.ui.form.on(“Quotation Item”, “price_list_rate”, function(frm, cdt, cdn) {
var d = locals[cdt][cdn];
frappe.model.set_value(cdt, cdn, “full_price”, d.qty * d.price_list_rate);
});
Hi @sheno
I think you have error at choose Doctype of Custom Script: correct is Quotation not Quotation Item
Pls try again.
1 Like
sheno
7
Hi
Your js is error. Try again my js
frappe.ui.form.on("Quotation Item", "full_price", function(frm, doctype, name){
var row = locals[doctype][name]
frm.set_value("full_price", row.qty * row.price_list_rate);
})
Your code works with field on Quotation, not on Quotation Item.
1 Like
Yes, you are correct,
try it
frappe.ui.form.on("Quotation Item", "full_price", function(frm, doctype, name){
var row = locals[doctype][name];
frappe.model.set_value(doctype, name, "full_price", row.qty * row.price_list_rate);
})