Get Items From Dropdown menu

Hello Guys,
I want to replicate core functionality in my custom app,there is dropdown button in Sales Invoice and i want the same for another doctype can anyone help me with its code ?? any guidance
here is attached image for this


Any help with highly appreciatable
@rmehta

https://frappe.io/docs/user/en/guides/app-development/adding-custom-button-to-form

@rmeyer Brother when we click this dropdown menu its show Sales Order,Quotation,Delivery Note Doctypes and when we click Sales Order its show this window

Here’s the original code:

same goes for Quotation and Delivery Note doctypes ?? only refernce will be changed right ?

I got errors for Delivery Note doctype… Which method should be used for Delivery Note doctype ?? @rmeyer