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 Display Mode to Never:
api.customerGroupEntry() |
Then in any other element doing the calculations, use a syntax check.
Also, set 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)
.isSyntaxCheck
is set to true
). Otherwise it is a normal logic run and this variable is set to false. The first run is really needed for the system to know what inputs the logic will generate.For more details on |