Hi, Anyone else facing an issue where Workflow Act...
# suitescript
s
Hi, Anyone else facing an issue where Workflow Action Scripts (with beforeSubmit Trigger Type) are not triggering?
b
usual options are that you messed up the script audience
or the workflow trigger
s
I am sure I didn't touched the script audience. When I change the Trigger On to "Entry" from "Before Record Submit", the script starts executing. But I need to execute at "Before Record Submit". Yes, 1 change I made was to change the Type of a workflow field (from Decimal Number to Checkbox) which was used in this action as a STORE RESULT IN. It seems after that I have started facing this issue. BUT, I have already deleted and readded both the WF fields and the custom action several times, but this doesn't seem to work.
b
on entry just means that the trgger is inherited from the state
so that would mean you are interested in the transitions into the state
im guessing from the name of the state that its the first one, which means you want to look at the event definition of the workflow itself
s
Actually this WF action in inside the first/start state. I am setting some values (on the line-level) in this WF action script using "Before Record Submit" When I use "Entry" trigger, I get error "recordObject.selectLine is not a function"
Yes this is the first state and based on the values I set in this WF action, the system selects which next state to transition to
b
i would expect you to get selectLine related error on any trigger you select, the record is not in dynamic mode
My guess is that you dont know what the workflow event definition is. And thus dont realize the on entry is not actually triggering before submit but instead on one of the other triggers
s
FYI, this is applied on Requisition record type and I am testing each time by creating a new Requisition record.
b
That is not the workflow event definitiion
s
image.png
b
you will notice that its all the trigger types
that means that the start is entered during before load
which explains why the script is triggering at all
both on entry and before submit triggers are not working before submit
you arent logging enough to tell that its before load
My guess would be that your workflow has a transition out of the start state that is activated before load
thus your script is not triggered when the record gets to before submit since its not in the start state
s
OK...I will try changing the TRANSITION ON of start state transitions to "After Record Submit"
Wow. Thank you. That did worked. So the state transitions don't wait much for the beforeRecordSubmit trigger until you tell them to wait by specifying TRANSITION ON.
b
the before load trigger occurred before you could get to before record submit
and then the record transitioned into another state, meaning that the starting state would never be entered during a before submit trigger
in general, you dont want to trigger on all triggers
1