yes, if you want it to be generated on demand, this is the way. Really to do anything in the UI where you need access to server side only suitescript modules.
1. UE script before load creates the button
2. Client handles the button click and calls suitelet
3. suitelet does the heavy lifting on the server side
if you don't need the on demand aspect of this then depending on your trigger/cadence you can just do this all in a single UE Scheduled or MR script.