Tanuj
November 6, 2015, 2:03pm
1
Hi,
Could someone help me out with this code:
frappe.ui.form.on('Quotation Item', 'item_code', function(frm, cdt, cdn){
frappe.call({
'method': 'frappe.client.get_value',
'args': {
'doctype': 'Item',
'filters': [
['Item', 'item_code', '=', locals[cdt][cdn].item_code]
],
'fieldname':'item_description'
},
'callback': function(res){
frappe.mode.set_value(cdt, cdn, 'item_description', res.message.item_description);
}
});
});
I’m trying to get the data under item description from my Item to populate item description under Quotation Item.
The same code has worked item_name weirdly.
Thank You!
The field for item’s description is just ‘description’ rather than ‘item_description’. Give that a try!
Tanuj
November 6, 2015, 3:57pm
3
Hi @alec_ruizramon1 ,
I forgot to mention that they were custom fields.
But I’ll try the default fields as well.
Tanuj
November 6, 2015, 4:13pm
4
@alec_ruizramon1 ,
The description field is linked even without the script, so something is probably wrong with the script.
Now i need to figure out how to change the description field to data field.
Thanks!
Tanuj:
frappe.ui.form.on(‘Quotation Item’, ‘item_code’, function(frm, cdt, cdn){
frappe.call({
write script on Quotation
instead of Quotation Item
Tanuj
November 9, 2015, 9:27am
6
Hi @kolate_sambhaji ,
No luck with that.
But I’ve managed to map the default description boxes.
Thanks for your help!
rmehta
November 9, 2015, 4:04pm
7
Tanuj:
frappe.mode.set_value
frappe.model .set_value
someone should pay me to catch typos
2 Likes