You will use a Calculated Field Set logic when you need to:
-
Enrich/calculate data of fields of records of object types:
-
Product
-
Product Extension
-
Customer
-
Customer Extension
-
Lookup Table (Customer Parameter)
-
Price Record
-
Rebate Record
-
Manual Price List
-
Logic API
-
Logic Nature: default
-
Logic Type: Calculation/Pricing
-
-
Execution Types:
-
Syntax Check - to define the input fields.
-
Standard - to calculate the results (e.g., prices) and provide warnings and alerts.
-
-
Information provided to the logic:
-
Standard
-
sku in context - Only for objects with sku field.
-
input.Customer
- Contains customerId. Only for objects with customerId field (i.e., Customer and CustomerExtension). -
api.currentItem()
- The record being enriched. -
api.global
- Contains data placed to api.global by the execution of this logic for the previous record (within one CFS calculation process). -
Allow object modification - true. This process can update data in tables (e.g., via api.update()).
-
-
-
Expected logic execution outcome:
-
From Syntax Check mode - input field definitions.
-
From Standard mode execution:
-
Result values of visible elements can be mapped to fields of the enriched object. If they’re mapped, then such result value will be stored in a field of the enriched record.
-
api.global
- Data stored here will persist until the next execution of this logic for another record (within one CFS calculation process within one node).
-
-
Configuration
Configuration of CalculatedFieldSet is set up on page
, where you can set:-
The object type to enrich.
-
A filter to select which records will be enriched.
-
The Calculated Field Set logic.
-
The mapping of which visible logic elements will be mapped to the fields of the records.
Common Logic Structure
-
Build input fields.
-
Abort on syntax check.
-
Read the current field values of the record.
-
Read the necessary data from any tables available.
-
Calculate new values.
-
Expose the values via visible elements.
Code Sample
-
CFS_ProductCostCurrencyConversion - A basic example of Calculated Field Set logic.