Good morning! I have a question about https reques...
# sdf
r
Good morning! I have a question about https request & NetSuite capabilities of async programming if I have a before or after-submit deployed on the item fulfillment record. This customer has a TON of scripts trigger on the ASUE of the ITFL. I would like to send the ITFL internal id to a RESTlet, the RESTlet is going to create a custom record. I would like the ASUE script to NOT wait for the response back from the RESTlet.. So, in other words just pass along the internal id then finish the ASUE script before the response is returned back. I've played around with NetSuite promises API and it doesn't seem to be truly asynchronous because my script won't finish until the response back from the HTTPS request. Am I just not understanding asycn programming or can anyone help with a way to do this?
c
What's the reasoning behind introducing the restlet? Creating custom records (as long as they don't have scripts on them) is very fast, it's probably not worth the extra overhead?
r
So, yes your right totally not a good use case. I just want to understand if that is possible because I could see us using it in a lot of other places. So, is it possible for a script(scheduled,suitelet,user-event) to make a https/http call to a RESTlet/Suitelet and NOT have to wait for the response back?
z
Why RESTLET? And this behavior is not NetSuite specific, it is regular HTTP... NodeJS, for example has the same logic... script will not finish until promise (or timeout exception ) finish
p
Don't know if it is still actual. Usage: • server-side script: https.requestRestlet(options) • client-side: https.post(options)