By Administrator on May 4, 2021
Beginner
frappe.ui.form.on('Sales Invoice',
{
    onload: function(frm) {
    frappe.call(
  {
   method: "frappe.client.get_value",
   args: {
     "doctype" : "Company",
     "filters" : {"company_name" : cur_frm.get_field("Company") },
     "fieldname" : "default_selling_terms"
    },
             
    callback: function(r) {
    var result = r.message["default_selling_terms"]
    console.log(r.message["default_selling_terms"]);
    cur_frm.set_value("tc_name", result);
    }
  },
             
    {
    method: "frappe.client.get_value",
   args: {
     "doctype" : "Terms and Conditions",
     "filters" : {"title" : cur_frm.get_field("tc_name") },
     "fieldname" : "terms"
           },
             
     callback: function(r) {
     var result = r.message["terms"]
     console.log(r.message["terms"]);
     cur_frm.set_value("terms", result);
     }  
  })
      }    
})


More articles on support



More articles on support
Comments

No comments yet.

Add a comment
Ctrl+Enter to add comment