How to call an event within another?

Hi Everyone,

I have few custom fields like checkbox and I actually want to call their events into another event so that I don’t need to re-write the code again in another event too.

Like for example, I want to call the below event on a value change in a data field:

frappe.ui.form.on("Sales Order", "pv_video_auto_id", function(frm)
//My Code will go here  

Thanks a lot for your quick response. It worked for me.