I am setting up a Workflow which will add a button...
# suiteflow
j
I am setting up a Workflow which will add a button to an Opportunity that when clicked, will add some default items to the Opp. My understanding of the Workflow Triggers has never been good, so I'm trying to understand it better. I have two states: State 1: adds a button in "Before Record Load" - transition on button click to - State 2: custom action on "Before Record Submit" I can't figure out why my custom action in State 2 doesn't work? It literally doesn't execute. If I use "Entry" in State 2 it works.
s
Because you are adding items to sublist, Some of the browser trigger may not work. What is the issue using entry state trigger for your actions to execute?
k
entry means "when it enters the state"
j
I can't get anything to work in State 2 if it's set to Before Record Submit. I tried some testing, made my custom action just write a log (nothing logged), tried replacing custom action with a User Error action (nothing). Seems that "Before Record Submit" doesn't work when called from a button click?
k
it is the right answer
before record submit is used from "edit" generally
j
yeah I tried both view and edit, no joy. Not to worry, I have my action working using Entry, I just wanted to understand why Before Record Submit doens't work.
I'm pretty sure I've used it elsewhere successfully.
s
If you are transitioning is not before record submit then your action before record submit is not going to work.
k
your button push transitions to state 2, which the record is not in when it is being submitted
so because it's not in that state it can't perform an action "before submit"
j
ahhhh
k
so if you had a single state workflow with no custom button
j
I hate workflows
they make no sense to me
k
you could have your before record submit to work (maybe? - I'm unsure on the item piece)
but then you'd have to change how you decided when it was adding those items
maybe a checkbox that gets unmarked when it adds the items
or something.
j
nah this way works fine
it's adding my lines!
so I am a happy @jen
k
Personally, I love workflows because they have me doing stuff that otherwise requires scripting
j
Oh I like scripting 😉
k
why not write this in script? That'd be easy enough.
if you know what you're doing
j
Boss likes WFs
k
(I don't)
fair enough.
s
I always prefer workflow over script because I find them easy to manage.
j
so we split the difference. I make WF for buttons/states, and then script the hard stuff in custom WF actions
@sam1128 depends on the WF. Some of mine are....fugly to manage
Thanks friends
s
Well I’m consultant and often client have administrator who also wants WF so that they can look after them because I know them well as well I often go down same path.