Multiple actions on click of a button

Hello, I’m new to ERPnext.
How to call multiple methods on click in one custom button. When the “accept” button is click it will call a query from a Doctype. I like to add another query from another doctype and when the certain condition is true, it will set a defaut value of a field. Thank you

you should write code in same method then call method