Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 75 Next »

You’re using Pricegrid logic when you need to:

  • build input field definitions for the price grid

  • calculate results of the price grid items

Logic API

  • Logic Nature: default

    • Logic Type: Calculation/Pricing

  • Execution Types:

    • Syntax Check - to define the input fields for the Pricegrid (i.e. NOT on the item)

    • Standard - to calculate the results (e.g. prices) and provide warnings and alerts for each item

  • Information provided to the logic

    • in the Syntax Check 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’s executed from Calculation Flow, via method withFormulaParameters()

      • api.currentItem() has PricegridItem - in this case, unlike the case of Pricelist, the current item is available all the time, because the item is created already before the logic is executed

      • api.global - contains data placed to api.global by previous execution of this logic for the another line (within one pricegrid calculation process)

  • Expected logic execution outcome

    • from Syntax Check 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 next execution of this logic for another line (within one pricegrid calculation process within one node)

Common Logic Structure

  1. build input field definitions

  2. abort on syntax check

  3. calculate the prices and other values

  • No labels