Custom Button to auto populate a custom field in Sales Invoice

Custom Button to auto populate a custom field in Sales Invoice

Hello,

I want help with a deluge for executing a  Custom Button in Invoices named 'Status of Invoice', where I would have 4 options to choose from after selecting the Custom Button: a) Del CHallan b) Dispatched c) Delivered d) Undelivered.

The logic of the script is such that when the user chooses any option, the name of that option should be auto populated in a Custom Field (Field type: Dropdown/Single line text box) in Sales Invoices.

Note: a)Defining 4 Custom button for 4 option of Status of Invoice is also acceptable