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

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 Administration  Calculated Field Sets, 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

  1. Build input fields.

  2. Abort on syntax check.

  3. Read the current field values of the record.

  4. Read the necessary data from any tables available.

  5. Calculate new values.

  6. Expose the values via visible elements.

Code Sample

  • No labels