I have a question about post-processing after reco...
# suitescript
b
I have a question about post-processing after record creation. If I use suitescript to create a record and want to do post-processing on that record as soon as possible (within seconds, preferably), but I also want to know as soon as possible whether the record creation was successful, what should I do? My understanding is that if I a use a UE script on the afterSubmit event, I will not know whether the record submit was successful until the UE script has completed execution. Is there any way around this?
c
Beforesubmit=record has not been saved. Aftersubmit=record has saved, do post processing
Another UE can actually die in its aftersubmit and stop yours from executing
But best to just assume it’s ok
c
@Benjamin Jung Look into N/task
@Benjamin Jung Specifically, you can create a scheduled script (or map/reduce, depending on your use case) that will perform the processing asynchronously from the afterSubmit flow. You can create a task in afterSubmit to trigger that script, passing it any parameters you need. This would allow the user event scripts to finish executing and return control to the user while queueing the post processing work to be performed on the server.
πŸ‘ 1
πŸ‘€ 1
b
@Clay Roper Thanks -- I did suspect hat module would be useful but didn't have the opportunity yet to look into it. I posted here hoping to hear from people actively using these features that are still new to me. πŸ™‚