Is there anyway to use Promises in RESTlets, or ar...
# suitescript
l
Is there anyway to use Promises in RESTlets, or are they not available?
c
Looks like you can use promises in server scripts if you're using SS2.1.
👍 1
a
Test your script before you go very deeps with promises, I do remember an underlaying bug where promises do not inherit property the role permissions that start it…
Properly***
l
I got the code to work, thanks for the help!
s
i'm curious what your use case is to want to use promises? I've found very few cases where promises would benefit my server-side code.
a
@Shawn Talbert Agree, promises are usually more commons or beneficial client side, where you normally do a pageInit promises to gather results that would be use later in sublistChanged and things like that. There are a couple of cases where promises server side are useful but to your point the percentages are low…
b
be very careful about your error handling with Promises, there is no global rejection handler
unhandled rejections are silently ignored
s
my advice would be to avoid promises here unless you have a legitimate advantage in using them.
💯 1