Set Field Value using Workflow Sublist Action Grou...
# suiteflow
r
Set Field Value using Workflow Sublist Action Group I have a need to store the Sum of specific items on a Sales Order in a custom field for reporting. Let say on a SO we have a mix of Items, some that start with AB-. I've used the Sublist Action Group on Workflows in the past for other purposes and thought I could create a Set Field Value action using Before Record Submit. In fact ... I have it working somewhat correctly. I've set the Condition to {line.item} Like 'AB-%' which works. The issue is with the Set Field Value formula. I've tried max({line.amount}) and all kinds of variation on the theme. All the workflow does is store the last line on the SO that matches AB-. So for example, if on the SO I have 3 lines such as AB-1 $200 AB-2 $400 AB-3 $650 .... the workflow is storing $650 in the field instead of creating a sum of all three line items. Any thoughts how to tackle this? Thanks -
b
Try using 'Custom Total Field'={line.amount}+{custotalfield}
You will also want to make sure you set that field to $0 in a previous action before your workflow runs, otherwise it will continue to add the total each time you save the record.
k
I'd actually do a summary saved search field - and push that into a stored value field instead
Alternatively - it might be better to script - depends on edit pattern/ other requirements.
r
Success! @Brian I modified my formula per your example and it now totals as designed. (note I did have to wrap the formula with a max statement per below). CustomFieldName = max({line.amount}*+{customfieldname})* I noticed the numbers adding up with "multiple saves" and a separate action first setting the field to $0 took care of that as you suggested. @KevinJ of Kansas I've never actually set a field value using a workflow with a saved search ... may give that a shot just to see how it works. Thanks again.
k
Oh man, I'll have to do that approach instead!
The saved search field is just a little bit clunky - I.e. "why do I have two fields for this?"