have you tried doing a button with the function as...
# suitescript
j
have you tried doing a button with the function assigned, making sure it works and then seeing how its rendered on the page