Assuming your script doing the creating isnt a use...
# suitescript
b
Assuming your script doing the creating isnt a user event
c
Oh
it is a userevengt
it's creating a cashsale on afterSubmit of fulfilment
so I want an afterSubmit on the cashsale
but it's not getting triggered.
I guess I could deploy this in fulfilment but set the script execution order for this one to be last to ensure all the revelant records are already created. I feel like that's dirty but NS expressly allows for that.
b
you can share logic between the 2 user events in a custom module
m
The other hack I've seen people do is have the user event script redirect to a suitelet and have the suitelet create the cash sale
I'm not a fan, I'm just throwing out another approach I've heard of. Definitely prefer shared modules
c
I just took the path of least resistence and added the script to the fulfilment record.