Price Grid logic is used when you need to:
-
Build input field definitions for a price grid.
-
Calculate results for price grid items.
Logic API
-
Logic Nature: default
-
Logic Type: Calculation/Pricing
-
-
Execution Types:
-
Input Generation – Defines input fields for a price grid (i.e. NOT for items).
-
Standard – Calculates the results (e.g. prices) and provides warnings and alerts for each item.
-
-
Information provided to the logic:
-
In the Input Generation mode:
-
SKU in the logic context
-
-
In the Standard mode:
-
SKU in the logic context
-
input
– Values of all inputs provided by the user. Or values passed into the calculation when it is executed from Calculation Flow, via the method withFormulaParameters(). -
api.currentItem()
has PricegridItem – In this case, unlike with a price list, the current item is available all the time because the item is already created before the logic is executed. -
api.global
– Contains data placed to api.global by the previous execution of this logic for the another line (within one price grid calculation process).
-
-
-
Expected logic execution outcome:
-
From Input Generation mode:
-
Input field definitions
-
-
From Standard mode execution:
-
Result values (and formatting) of the visible logic elements will be copied by the system to the attributeX fields of the PricegridItem.
-
api.global
– Data stored here will persist until the next execution of this logic for another line (within one price grid calculation process within one node).
-
-
Common Logic Structure
-
Build input field definitions.
-
Abort on input generation.
-
Calculate prices and other values.