I wrote a user event script on Work Orders for bef...
# suitescript
m
I wrote a user event script on Work Orders for beforeSubmit. It works fine on the created work order I’m on, but it won’t trigger on work orders that are auto generated for the sub assembly on the same work order. I would have expected that the script would run on any work order that is created. Checked my deployment settings: context is all, run as admin, all roles, and it is released. Is there something I’m missing? Do UE scripts not work on auto generated or bulk processed records?
e
While I don't know about this specific use case, I do know that many native operations for many record types don't necessarily trigger User Events.
m
I just changed it to afterSubmit and added a hardcoded value. This time the logs do show it affected the auto generated work order. I’ll just have to play around to get it to use lookup values.
What it is supposed to do is lookup the main WO assembly and check a custom value for minimum build quantity and then enforce that by changing the quantity on the WO.
In case anyone ever needs to know, from my logs, it looks like the processing is done in reverse order. The linked worked orders are processed first, then the main work order is processed. Seems like a record.load() will be needed for post processing instead of direct manipulation.