Hey everyone! I have a workflow question. The work...
# general
j
Hey everyone! I have a workflow question. The workflow converts the item quantity down for a specific customer of ours. Logic is simple - If item is ABC then divide the quantity by 8. I use the sublist action group and have two set field value actions where each action is dependent on the item. Issue: when both items are present on the sales order, it works. When only one item is present, it doesn't work. Any idea to why this is?
m
Check the workflow logs...see if one of the actions was skipped or if there was an error returned
j
@MGBC weirdly, it doesn't even show up in workflow history. even for the orders I know it worked successfully on
m
Did you enable logging?
m
What is your condition logic? Are you using AND between them instead of OR?
j
@Michael McNamara I didn't realize there is a condition logic. I don't see anywhere to put a condition logic between the two set field values
m
What I mean is, if I were to set a condition, I have to use the name because the internalid is not a selection and I would have to type in the name as a value. I can’t see your action panel so I’m not sure how you set this up.
j
@Michael McNamara That condition is set to "and" by default. But I have two set field value actions. You can see them in the screenshot in the original post!
m
@Jackie Yang if you have logging enabled and set to "Always" you can review the workflow logs...then select "Show Rejected Actions" and it will show you all actions that were either skipped or had an error. Then you can see if the issue is an error, or if it was skipped then an issue with the logic you have set.
image.png
m
@Jackie Yang I just tried this on my end exactly the way you have it and I was able to use either one or the other item, or both and it calculated properly in all variations.
j
@Michael McNamara I appreciate all your help on this! I've enabled logging so now I just wait to see it in real time!
m
It looks like you set your event type to APPROVE in the image. I set mine to CREATE. I also used EDIT, but that would cause problems if you edit it again and again because it would keep dividing each time.
j
@Michael McNamara yes event type is only approve. But I doubled checked system notes and it was approved only once. The issue again is that it's not dividing at all, but only when the item present is only the latter item instead of both
m
One thing you can try is to make a custom transaction line field called "new quantity" (or something like that). Then in your action above set the "new quantity" field using your formula and conditions. Then make a new Sublist action group on After Record submit. This would set the native quantity field from you New Quantity value. Sometimes I find that an action fails when you try to do too manythings at once. Like if it's a line field AND a calcualtion and its a native field with other backend scripts it fails...but if you do the calcualtion into a custom line field using one trigger then copy it back into the native field using the next trigger in line it works
not an ideal solution but does tend to get it to work in the end