How to click on get items on Custom Script

Hi All,
Just need to know how to make the get items button clicked if the bom no is there. Following is my try. Thanks.

frappe.ui.form.on(‘Stock Entry’, {
refresh(frm) {
msgprint(‘Click the Above’);

I tried this and worked. Hope you have a better solution.