I have created a workflow for vendor bills to be s...
# suiteflow
d
I have created a workflow for vendor bills to be sent for approval regardless of dollar amount, and once the bill is approved and if someone edits the amount on the bill the bill needs to go to pending approval again. How do I achieve this? Workflow is checked for create, view and update as well
a
In your Approved state make a transition back to Pending Approval using the After record submit trigger. Then anytime the Bill is in the Approved state and someone does an edit/Save it will transition back to pending approval
d
i tried that, and now my bill does not go to approved status upon clicking approve.
a
If you look at the workflow history does it go to the Approved state then immediately back to Pending approval?
If so try adding a custom checkbox to your bill record called “Edited” Add an action to the approved state that checks that box (before user edit or before record submit) Then add a condition to you Transition of Edited checkbox = T Also remember to uncheck the edited checkbox upon entry of Pending Approval state
So checkbox = F in Pending Approval State Checkbox = F when first entering Approved state Checkbox changes to T when edited in Approved state (triggers transition) Checkbox = F when it moves back to pending approval (Loop continues)
d
yes it geoes to approved state and then back to pending approval
ok
let me try and thank you for the in inputs
How do i trigger this "Checkbox changes to T when edited in Approved state (triggers transition)"
a
Add an action to the approved state Action type = set field value Trigger type = before user edit Parameter field = custom edited field
Value = checked
d
If the approved state is not set at do not exit workflow. my wf is just stuck at loop and wont approve, got sometime to check this out?
a
Hmmm. In the approved state is the set field value action triggering on before user edit?
d
it was on entry, i have updated to before user edit now, and its still same
j
You'll need to add criteria to the transition (after record submit) back to the pending approval state. You do not want the approved state to be
do not exit
1. Add a workflow field that stores the amount after you leave the pending approval state 2. In the approved state, add a transition (after record submit) back to pending approval state if the
AMOUNT
!==
Workflow Amount Field Amount
3. Once back in the pending approval state, you reset the Workflow Field Amount after it transitions into the second state of the workflow
I think you might be able to just add criteria to check the old record value, and compare the old record amount to the current amount set. But I find it easier to capture data in workflow fields, then I can query on them if I'm looking into of debugging WF Logs.
a
@Josh Godfrey Won't that just require re-approval if the amount changes. I thought he was requesting ANY change to the Bill requires re-approval, that's why I was going with the custom checkbox that would be checked anytime someone clicks the edit button.
@Josh Godfrey oh whoops...my fault, reread his request it is on amount🤦‍♂️ I made this overcomplicated sorry
netsuite 1
j
I skimmed through the conversation but saw this on the original comment
"bill is approved and if someone edits the amount on the bill the bill needs to go to pending approval again."
a
@Deepthi sorry yes Josh's way is a good way to do it. I missed that you were only looking for amount changes. I steered you wrong for a few days there.
d
hey you'all this worked! thank you 🙂
netsuite halo 1
j
Out of curiosity, did you check the old record value, or did you store the value in a WF Field?
d
checked old record value
j
Nice! Happy it worked for you.
d
thank you again. also the approve bills page doesnt it show bills for 2 level role based approval wf or does it need soemthing to be enabled?
j
How are you determining who needs to approve? Just the user role?
d
yes just user role
j
You might need two pending approval levels Pending approval state 1 === UserRole1 Clicks Approve (transition to pending approval state 2 where UserRole2 needs to approve) OR Pending approval state 1 === UserRole 2 Clicks Approve (transition to approved) Pending approval state 2 === UserRole 2 Clicks Approve (transition to approved)
Something like this, but we require employee and supervisor approval. You would do the same thing but if the second level user approves in state two, you could skip the second approval state.
d
yes these are setup correctly, great thank you
in this page once the first approver is approving from here, it gets approved and doesnt go to second approver
but if i view bill and approve it, it goes for 2nd approver, doesnt approve bill page trigger to second approver