I know you cannot chain UserEvent scripts together...
# suitescript
s
I know you cannot chain UserEvent scripts together, but if UE Script on CustomerRecord1 creates a Transfer Order, should the Transfer Order's UserEvent scripts execute?
n
Yes
s
That's what I think too!
the before load is being called, but not the beforeSave. Any idea why?
NVM. It just took a minute or 2 for the log to show
n
👍
s
back to the drawing board. Someone else created one, which showed up in the log. Ok, so it does not appear to be triggering the beforeSubmit?
Ok, so what is making it to the beforeLoad is the print task that is happening. the CustomRecord UserEvent creating a TransferOrder, doesn't seem to be triggering the UserEvent Script of a TransferOrder :\
n
It looks like nested user event scripts don't work after all
Important User event scripts cannot be executed by other user event scripts or by workflows with a Context of User Event Script. In other words, you cannot chain user event scripts. You can, however, execute a user event script from a call within a scheduled script, a portlet script, or a Suitelet.
c
You can chain User Events using workflow actions
Similar to the note above. You can have one that sits and waits and does another save but typically you can do it a better way.
I'd have a suitelet that your custom record UE calls that creates the record if you want it to fire the UE and call it a day.
👍🏼 1
s
Most of the logic is in a bl script anyways, so either way is fairly easy. However, I was curious of your thoughts @creece. Does it make sense to make a generic suitelet that takes the parameters needed for saving, and then anytime I need to chain userevent scripts, just load and immediately save? Other option is to move the logic that calls the bl to the suitelet which is also fine
just curious of your thoughts since you've experienced this before
c
This seems like just a 1 off that you need to create the record and fire the UE so thats really all you need is a 1 off suitelet that'll handle it. If you want to make something generic go for it but I wouldn't go much past the suitelet creating it.
s
Is there a way to call it without making it public and requiring the full url?
c
you can use resolveUrl of the suitelet if thats what youre asking. Then you just post to it or whatever you wanna do
s
That's what I'm doing, but it is saying I'm not authorized unfortunately
I'm getting a {"type":"http.ClientResponse","code":500,"headers
c
I thought they just changed this so you can make it available maybe im confused lemme take a look
You may need to go the workflow action route
So a workflow on the record type that has a workflow action that does the creation which will fire the UE.
does suiteanswers 81081 not work? You could set it up that way definitely
s
it does, i was trying to avoid the redirect though, as when I did it redirects to a page and says "there are no records of this type