Let's assume you want to show the customerId value in the outputs.
If you used just api.customerGroupEntry()
, then the result in UI would be shown as e.g., "CG['customerId' = '60838']".
The correct procedure to display the value '60838' is:
api.getElement("CustomerGroup").customerFieldValue
, depending on what is in the CustomerGroup element.First define the CustomerGroup element, set the Display Mode to 'Never':
api.customerGroupEntry() |
Then in any other element doing the calculations, use a syntax check.
Also, set the Display Mode of this element to 'Quoting' at least.
if (api.isSyntaxCheck()) return //as the first line if (api.getElement("CustomerGroup").customerFieldName == "customerId") { return api.getElement("CustomerGroup").customerFieldValue } |
It is used in two use cases:
api.getElement("CG")
and will decide to put there a new BigDecimal(1)
.For more details on isSyntaxCheck see Miscellaneous Functions. |