Print Supplier Name in BOM Explorer Printing

Hello,

I am getting stuck in getting first line of supplier name specified in Supplier Items (child) table of the Item. I would like to print the supplier name in the BOM print out at BOM explorer. Anyone can share me what is the best method and how can I get to try?

Thanks and Regards,
Edward

Dear Fung,

you can try to query database with your item code and get required data from there, my custom field query at below.
we have 2 extra field in our price list one is item_rate other is installlation_rate i am getting them via item code.

cur_frm.cscript.fetch_rate = function(frm, cdt, cdn){
  var row = locals[cdt][cdn];
  if (row.item_code && !row.item_rate && !row.installation_rate){
    frappe.call({
      method: 'frappe.client.get_value',
      args: {
        doctype: 'Item Price',
        filters: {
          'item_code': row.item_code,
          'price_list': frm.doc.selling_price_list,
        },
        fieldname: ['item_rate','installation_rate']
      },
      callback: function (data) {
        frappe.model.set_value(cdt, cdn, 'item_rate', data.message.item_rate);
        frappe.model.set_value(cdt, cdn, 'installation_rate', data.message.installation_rate);
        frm.refresh_field('item_rate');
        frm.refresh_field('installation_rate');
      }
    });
  }
};