Question regarding script execution: let's say yo...
# suitescript
s
Question regarding script execution: let's say you have a scheduled script which is iterating over some records, and triggering a workflow action script using workflow.trigger for each iteration. Does anyone know whether this process is synchronous? Ie: does the scheduled script wait for the results of the workflow before continuing iterating through? More specifically, if something goes wrong in the workflow, will it be caught in the scheduled script context or is the workflow action script executed asynchronously in another context?
r
Not sure if its the same case with workflow actions but in the past if my sched script triggers a UE and there is an error in the UE, it is passed to the sched and the sched throws an error.
s
I had the trigger.workflow wrapped in a try catch and it doesn't seem to pick up something going wrong in the wfa, which makes me think it's executed separately.
l
I'd be curious as to what is the pain point behind this question. I personally haven't experienced this design as for me, this is not the ideal way to do it. Workflow action scripts are almost an overkill. Will it make sense to refactor the code in a way that the logic is incorporated already on the scheduled script itself?