Factoring in Purchasing Order Multiple Quantity

I was able to factor in during entry of Material Request Item (Child Table of Material Request Doctype).

frappe.ui.form.on("Material Request Item", "qty", function(frm, cdt, cdn) {
    var d = locals[cdt][cdn];
       frappe.db.get_value("Item", {"name": d.item_code}, "multiple_order_qty", function(value) {
            d.multiple_order_qty = value.multiple_order_qty;
            if (d.qty  <= d.min_order_qty) {
                d.qty = d.min_order_qty;
            } else {
                d.qty = value.multiple_order_qty * Math.ceil (d.qty / value.multiple_order_qty);

How can I trigger every row using a custom button on the Material Request Form?