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 79 Next »

 Table of Contents

Price list logics are used when you need to:

  • Build input field definitions for a price list.

  • Calculate results for price list items.

Logic Selection

When a price list item is about to be calculated, the engine selects a logic based on certain criteria. Besides the standard factors (if the logic is active and valid for a target date), there are also the following rules. (If more logics satisfy the criteria, the first one available is used.)

  1. Product specific logic

    • If the product has a logic defined (in the Product table), it is used. Using this type of logic can be switched off by Advanced Configuration Option doNotUsePerProductFormulasInLists.

  2. Logic selected in the price list definition

    • This logic can be pre-filled from the Price List Type (if it was used by user).

    • It can be also set by a user.

  3. Default price list logic

  4. Default generic logic

Logic API

  • Logic Nature: default

    • Logic Type: Calculation/Pricing

  • Execution Types:

    • Syntax Check – Defines the input fields for the price list (i.e. NOT on the item).

    • Standard – Calculates the results (e.g. prices) and provides 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

      • Values of all inputs provided by the user

      • CurrentItem has PricelistItem, but only in the 2nd (and next) passes of the multi-pass calculation. I.e. in normal calculation, it will not contain it.

      • api.global – Contains data placed to api.global by previous execution of this logic for the another line (within one price list 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 PricelistItem.

      • api.global – Data stored here will persist until the next execution of this logic for another line (within one price list calculation process within one node).

Common Logic Structure

  1. Build input field definitions.

  2. Abort on syntax check.

  3. Calculate prices and other values.

Mapping of Logic Results to Price List Item (PLI)

When the item logic finishes the calculation, the element results are mapped and copied to the PLI.

To be able to use the logic result on the PLI:

  • The logic element must have Display Mode set to Everywhere (or to Price List).

Output Elements Mapped to Attribute# Fields

  • The business user selects which visible elements they want to map to PLI – when creating a new price list (step Parameters, section Output Elements).

  • If you need to enforce that certain elements are always mapped (i.e. the user cannot unselect them), use the Advanced Configuration Option mandatoryPLElements.

  • Mapping of selected element results to the PLI attribute# fields is done automatically, but if you need, you can set specific elements to be mapped to specific attributes – see Advanced Configuration Option calculableObjectPreferredMapping.

Special Logic Results Mapping

In the New Price List Definition dialog in the Set Parameters step, the user can also specify which element result will end up in PLI’s fields:

  • calculatedResultPrice – setting Result Price

  • unitOfMeasure – setting Dynamic UOM

  • currency – setting Dynamic currency

  • No labels