Pricefx Classic UI is no longer supported. It has been replaced by Pricefx Unity UI.

 

How to Create Price List and LPG Types


Aim of this article

Explains how to create Price List and LPG Types (templates that add a predefined header to the Price List or LPG detail page). The setup consists of: 

Related sections

Price List and Live Price Grid Types (Reference Manual)


Create a Price List / LPG Type

  1. In Administration > Header Logics > PL/LPG create a header logic for the PL/LPG type. (See examples below.)
  2. Make sure you have the Manage PL and LPG Types user role.
  3. In Price Setting > PL and LPG Types, create a new type.
    • Enter a Name and Label.
    • In Type select Price List or Price Grid, depending on where your header logic is intended to be used.
    • Select the previously created header logic in Header Logic.
    • Optionally, select a saved view preference. (In Price Lists, this presets the field Copy preference from).
    • Optionally, set view/edit limitations for user groups.
  4. When creating a new:
    • Price List – In the Define Price List step, select the required type from the Header Type drop-down list.
    • LPG – In the Header Type column, select the required type.

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.

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:

return api.inputMatrix("m","Type","Coefficient")

In the PL/LPG logic use:

def cp = api.getParameter("m")

Using Configurator

In the header logic use:

def ce = api.createConfiguratorEntry(InputType.INPUTMATRIX,"m")
ce.getFirstInput().addParameterConfigEntry(
  "columns", 
  ["Type","Coefficient"]
);

return ce

In the PL/LPG logic use:

def configurator = api.getParameter("LPGConfigurator")
def cp = configurator.value["m"]

Save and Recalculate

After you enter your inputs in the first section of the header and click Save, the header logic is executed and the header is updated. 

After you click Recalculate header, the header is updated. The line item table is refreshed too (but not from running the line item logic): lines are only added/removed but the existing ones cannot be edited. 


Found an issue in documentation? Write to us.