Price List Header Logics

In this section, you create a calculation logic that defines the header of a Price List or a Live Price Grid. The logic then serves as a definition of Price Setting Types.

The header is split into three sections which contain:

  1. Any logic of your choice which can modify the Price List / LPG or provide inputs for them.

  2. Charts for the Price List / LPG.

  3. Summary with calculation results.

In the Price List / LPG detail, users can select which sections to display:

The content of the header is defined by a header logic.

Define Header Logic

In the header logic, provide definitions for the three parts of the header.

First Section: Any Logic

This logic can perform any standard operation, such as:

  • Generate user input fields to drive or simulate prices of the products included in the Price List or LPG. For creating inputs, use the usual input functions

    Example

    api.integerUserEntry("Discount")

    You can also use the configurator.

  • Add, rename, modify or delete columns in Price List / LPG.

    Example: Add Columns to LPG

    def pg = api.currentItem() if (pg != null) { api.createOrUpdatePricegridInputAttribute('attribute10','color','Color', pg['id']) api.createOrUpdatePricegridInputAttribute('attribute11','size','Size', pg['id']) }
  • Add or remove products to or from the Price List / LPG.

    Example: Add/Delete Products

    api.addOrUpdate("PGI", ["priceGridId" : 4, "sku" : "B-0004", "label" : "New product"]) api.delete("PGI", ["priceGridId" : 4, "sku" : "B-0004"]) //For matrix price grid item manipulation, you need to specify the secondary key (key2): api.delete("XPGI", ["priceGridId" : currentItem.get("id"), "sku": "MB-0007", "key2": "B-0002"]) api.addOrUpdate("XPGI", ["priceGridId" : currentItem.get("id"), "sku": "B-1111", "key2": "B-2222", "label" : "New product"])
  • Update attributes and prices for the products in the LPG and prices in Price List using the standard methods.

  • Read all parameters, attributes or prices from the line items (products) and do a summary and display the summary in the output header section.

This logic always executes in the input generation mode.

Second Section: Chart

For a graphical representation of the output, use the following methods:

Third Section: Calculation Results

To display a table with calculation results, use the following methods:

Call Header Logic from Line Item Logic

In the line items logic for PL/LPG you need to read the inputs entered in the header. 

Standard Input 

In the header logic use:

In the PL/LPG logic use:

Using Configurator

In the header logic use:

In the PL/LPG logic use:

Found an issue in documentation? Write to us.

 
Pricefx version 13.1