I have a Work Order (special WO) that spawns a chi...
# suitescript
c
I have a Work Order (special WO) that spawns a child Work Order for an assembly. NetSuite handles this themselves as native functionality. I have a UE attached to the Work Order with a beforeSubmit and afterSubmit event. When saving the parent, beforeSubmit fires and so does afterSubmit. I then see logs for the child Work Order UE firing but it never fires beforeSubmit and only fires afterSubmit. There's no conditional around the beforeSubmit it just sets the Assembly Item's Display Name on the Work Order. Anyone know if this is by design for NetSuite or a defect? I'm leaning towards defect as I don't see why beforeSubmit would only fire on the 1 Work Order. I've confirmed this by moving the method that does the setting from beforeSubmit to afterSubmit and it still fires so beforeSubmit is just not being called on child Work Orders.
b
fairly common for transactions that are automatically generated
same thing happens for drop ship and special order
c
Only afterSubmit fires? Doesn't that seem totally incorrect?
I don't understand it honestly
I can source the field I need (Work Order Assembly Display Name) directly onto the record I need (Operation) but its a 2 join so when I go to search on Operations, it gives error text as its too many joins away for a search. Maybe the current solution to this to use the query module as I think i can get it that way even if its 2 joins away via a search and not have to source anything.
b
user events fire for specific events
dont expect all entry points to trigger for all events
c
I am controlling the UE. It fires for any event. It just doesn't fire beforeSubmit and only fires afterSubmit when NetSuite does their background processing.
like somehow they are saying "skip beforeSubmit" even though its my script.
b
compare the supported user event types for a beforeSubmit to a afterSubmit
they arent the same because they dont support the same types
💯 1
a
@creece record.load(scriptContext.newRecord) in afterSubmit and be happy...
c
Thanks for the assistance you 2. I'll dig into it.