I've asked something like this before, but wanted ...
# suitescript
s
I've asked something like this before, but wanted to check. I find that if a scheduled WF sets a field on a record then UE scripts in that record do not run. This is despite Workflow being set as an allowed context in the script. I have found references to a similar bug on Google. I created a Workflow Action Script to set the field value rather than the built in function, and that works, triggering the UE script. UNLESS the WFA is in a WF which also has a sublist action. Then the WFA doesn't trigger - or rather it dies according to the logs but the WFA doesn't set the field. The whole thing is a nightmare.
a
> then UE scripts in that record do not run you've got a UE script deployed to this record type, with 3 entry points and each entry point the first line of the function is a
log.debug
that says triggered from
context.UserEventType
and you're getting zero logs?
I phrased it this way because if you've got an if context.UserEventType == EDIT that you think should be true... the WF might actually trigger an XEDIT rather than an EDIT (I don't actually know) just a thought
s
Doing some more delving, I can see that the BeforeLoad function runs if triggered from a WF, but the BeforeSubmit and AfterSubmit functions do not.
The only reference I can find in the docs is
Copy code
User event scripts cannot be executed by other user event scripts or by workflows with a Context of User Event Script.
Which kind of implies that workflows with other contexts, specifically Scheduled, should be Ok. But it seems not.
Has no one else had a problem with scheduled WFs not triggering UE scripts? I can see this which suggests it's not just me. https://netsuitehub.com/forums/topic/documentation-on-whether-user-events-are-triggered-from-workflows/
Damn
e
So glad they're still writing 1.0 in their own examples 😞
a
I've never run into this... thanks for highlighting, this is kinda insane