Quote Item logic is used when you need to:
-
Create input fields for a quote line item.
-
Calculate some results (e.g. prices) for a quote line item.
-
Warn the user when some lines cannot be calculated.
-
Alert the user that there are some business problems with the inputs or results.
Logic API
-
Logic Nature: default
-
Logic Type: Calculation/Pricing
-
-
Execution Types:
-
Syntax Check – Defines the input fields.
-
Standard – Calculates the results (e.g. prices) and provide warnings and alerts.
-
-
Information provided to the logic
-
Context:
-
sku - for which SKU it is executed. See api.product("sku") for usage.
-
commandName - info about which operation caused the execution of this logic, e.g. if it was Recalculate, Submit, etc. See api.currentContext() for details.
-
-
Input parameters:
-
Customer – ID of the customer. It can be either from the header or from the item (if it is specified there).
-
Names and values of the item’s inputs.
-
Names and values of the parent folders and header (i.e. values of inherited input fields).
-
-
Current item – QuoteLineItem as Map
-
api.global
contains:-
Data stored in api.global in the Quote Header logic pre-phase.
-
Data stored in api.global by execution of the previous quote line (within one recalculation process).
-
-
-
Expected logic execution outcome:
-
From Syntax Check mode
-
input field definitions (stored in the logic context)
-
-
From Standard mode execution:
-
Results of elements with Display Mode Everywhere (or Quote) – Stored on the quote line item in the field outputs
-
Warnings – Stored together with the element’s result in which it was raised.
-
Alerts – Stored together with the element’s result in which it was raised.
-
api.global
– Data stored here will persist until the next execution of this logic for another quote line item (within one recalculation process).
-
-
Mapping of results to the QLI
During the process of Quote recalculation (or also Quote Item Addition) the system executes the logic and once it finishes it will:
-
takes all result values (including formatting, warnings and alerts) of visible elements, and stores them to the outputs field of the QLI object.
-
does some default mappings, e.g. stores to the QLI information about SKU, product label, input field values.
Common Logic Structure
-
Elements with functions which are used across all logics.
-
Elements with definitions of input fields.
-
Element AbortOnSyntaxCheck which aborts calculation of the next elements when the logic is executed in the Syntax Check mode.
-
Elements with:
-
Calculations, reading of data from tables
-
Exposing result values, warnings and alerts
-
Code Sample
See Quote_Item_Simple.