Does the after record submit trigger (for another ...
# general
l
Does the after record submit trigger (for another record and not the record that is saved by the user) affects the user experience or not? I presume no?
i
not sure what you mean by user experience? i havent tested but i believe it would cause a Record Has Changed if the other record was being modified on the UI and they go to save it
a
Submitting a record within the execution of a User Event Script, by design, does not trigger a beforeSubmit or afterSubmit event on the record it saves. One reason for this is to prevent accidentally creating an endless loop of submit-trigger-submit-trigger... You can still force this to happen by having the UE script kick off a task or make a request to another server script like a Scheduled, Map/Reduce, or Suitelet script, and then add code and/or execution context filtering to prevent the endless loop (if needed due to the target record being the same type, user event filter, etc.), but if you find yourself doing this, first ask whether you need to rethink your approach. There's often a better way.
l
Sorry, what I mean is when the user save a PO that has a user event script to update a related SO (after record submit), does that slow the submission in the UI because the related SO has to be updated first in the backend? Or it does not slow the saving because it's done after submit anyway
i
it will slow down, even though it's an after submit it will wait until the after submit of the related SO
l
Noted. Thank you
a
Ah I see I misunderstood your question. Sorry about that! Israel Gonzalez is right. This is why many NetSuite developers and admins prefer to avoid putting too many operations in user event scripts and user event workflow actions. They increase the load and/or save times of the records triggered. What I said above still applies though: Your script saving the related Sales Order after modifying it, I do not think it will trigger further user events on the Sales Order, so you will not incur a performance penalty in a chain-reaction way. I think the performance slowdown from the Purchase Order-deployed script will only occur due to that and other UE scripts and workflows deployed to the Purchase Order record type, and not the Sales Order record type (that one should only incur slowdown due to the scripts and workflows deployed to Sales Orders).