anyone know how to create a simple button on sales...
# suitescript
f
anyone know how to create a simple button on sales orders that when clicked just triggers a custom suitescript? i SCOURED the internet far and wide and there is NO useful documentation ANYWHERE.
a
standard design here is actually more confusing than it should be... 1. before load user event script on the SO to create the button with the function call and any parameters needed set 2. client script to execute the function on the button when clicked using
https
module to your suiteleturl with params as needed 3. suitelet script to actually execute and do the work you want to do
👍 1
f
wow that's freaking insane lmfao
all my logic is handled in my user event script... is there no way to just straight up execute the logic in that UE script @Anthony OConnor? 😂
a
it really is... but once youve done it a few times it really just becomes muscle memory
f
😭 💀
a
oh I was assuming you needed to get back to the serverside to do some server specific stuff... if you can handle it all client side you can just do the work in the client script no need for an https call, and no need for a suitelet
f
aren't UE scripts server-side?
a
yeah but they dont trigger on button clicks 😛
f
😭 😭 😭
e
Extract the logic that is common between the UE and the button click into a custom module, then you can invoke the custom module from both the UE and the button handler
f
@Anthony OConnor would you mind just taking a quick peak at my source code and let me know if i can rawdog it with a client script?
e
Video:

How do I add a button to a NetSuite record with SuiteScript?

a
eric got you 🙂
f
oh thanks for sending that over @erictgrubaugh
e
It's older, but should still be applicable to get all the wiring in place
a
so young Eric 😉
😂 1
e
ikr?
f
related question... is there a way to extract a
script deployment
record's
execution log
to a CSV?
a
I've never wanted that... but i figure you can just filter the script execution log and click the csv export button?
image.png,image.png
f
odd.. i don't see that
a
that's on the script deployment record... if you look at the second screen shot that's how you navigate the the logs list page, and you can then filter from there
f
oh i'm sorry, yea i see that now
appreciate it heaps 😄
e
If you need to do it via script, I think you can do a Search with a
type
of
scriptexecutionlog
, though I don't see that in the
search.Type
enumeration