Set up Custom Dimension Lookup

Prerequisites

  • Price Setting Accelerator is deployed.

  • New custom dimension is not the 7th dimension.

  • You are a Configuration Engineer or have sufficient knowledge of Groovy coding, Pricefx Studio and Pricefx Sandbox.

Assumptions

This example assumes:

  • You already have 3 product dimensions under “Fallback” Feature Name.

  • You want to add a custom dimension as the 4th dimension.

  • If you have “per-feature” hierarchical lookups defined, these will be unaffected.

Configuration Steps

Add Custom Dimension to PriceSettingDimensions Price Parameter

Go to the Price Parameter PriceSettingDimensions and add a new row:

  • Dimension: “Custom”

  • Order: “4”

  • Feature Name: “Fallback”

  • Field Name: According to your needs. This variable will be the name of the column and will be referenced in the code.

ảnh-20240326-075616.png

Run Bootstrapping Again

To make this new custom dimension available in <dependency> Price Parameters, use Price Setting Accelerator Configuration Wizard to add a new dependency level.

  1. Select Core Elements in the list and click the Configure selected module button.

    ảnh-20240326-081300.png

     

  2. Select Configure Dependency Level button.

     

  3. Select Add new Dependency Level button.

     

  4. Fill in necessary information and click the Apply button.

     

  5. Now, you will have the CustomDimension column in <Italy> Price Parameters:

     

  6. You need to add pricing data into the Price Parameters to start using the custom dimension, as shown below.

     

Edit Price List Logic

The previous steps prepared data and configuration and now you need to adjust lookups by updating the Price List logic. In the (In)DependentPriceListLogic, you need to get a custom dimension value for each product and pass it into CustomDimensionManager.

  1. Create a new element called “CustomDimensionValue”. It needs to be placed below the out-of-the-box “CustomDimensionManager“. Your new element does not need to be visible, you do not need to occupy any of 100 allowed attributes.

     

  2. In the new element:

    1. Add a logic to get the custom dimension value.

    2. Fetch manager by out.CustomDimensionManager.

    3. Pass PLI/PGI’s value of your custom dimension into CustomDimensionManager by using the method addCustomDimensionValue.