Normally the common approach to execute something ...
# suitescript
a
Normally the common approach to execute something from a Client Script on a button Click, Edit or View would be to attach the client script to the form...