Adding Custom Button To Form and open Stock Entry

how i can open Stock Entry from new custom button


frappe.ui.form.on('Device Maintenance Card', {
    refresh: function(frm) {
   
      frm.add_custom_button(__(" Open Stock Entry"), function(){
      
          
      });   
   
  }
});

Hi @Osk:

Do you mean create a new Stock Entry?

frappe.ui.form.on('Device Maintenance Card', {
    refresh: function(frm) {
      frm.add_custom_button(__(" Open Stock Entry"), function(){
          frappe.new_doc("Stock Entry")
      });   
  }
});

Hope this helps.

thanks for the help exactly what i want