How to Update Hint of Customer/Product Group Inputs
This article applies to versions lower than 8.0.
Problem
Customer/Product group‘s filter label does not reflect the new value after recalculation.
Root Cause
In Ember, when user selects a filter in Customer/Product group, the filter label is manipulated and put into ‘label’ + ‘valueHint’ field so it will be shown in the UI (as detailed below). One thing to notice is that the ‘valueHint’ has higher priority than ‘label’ in the overview view.
Then, when recalculating the model, if calculation logic just updates the ‘label’ but not the ‘valueHint’, user may see the wrong old ‘valueHint’ filter label.
User Interface
Calculation Logic
Although we updated the value and label to “CustomerID contains 0002”, the Customer Group still shows the old label “CustomerID contains 0000”.
processor.addOrUpdateInput("ROOT", [
name: "CustomerGroup",
label: "Customer(s)",
type: InputType.CUSTOMERGROUP,
value: [
"customerFilterCriteria": [
"_constructor": "AdvancedCriteria",
"operator": "and",
"criteria": [
[
"fieldName": fieldName,
"operator": "iContains",
"value": filterValue
]
]
],
"label": fieldName + " contains " + filterValue // new value “CustomerID contains 0002”
]
])
Solution
Clearing or updating the ‘valueHint’ accordingly. For example:
processor.addOrUpdateInput("ROOT", [
name: "CustomerGroup",
label: "Customer(s)",
type: InputType.CUSTOMERGROUP,
value: [
"customerFilterCriteria": [
"_constructor": "AdvancedCriteria",
"operator": "and",
"criteria": [
[
"fieldName": fieldName,
"operator": "iContains",
"value": filterValue
]
]
],
"label": fieldName + " contains " + filterValue
],
"valueHint": null // or the built label above
])
Then, after recalculation, the updated label will be shown:
Found an issue in documentation? Write to us.