Standard Groovy Modifications

Add Custom Field to Price List/Grid

  1. Navigate to Administration  Logics  Generic Logics.

  2. Select PSP_PricingLogic and duplicate it.

    • Rename it to "Training_PSP_PricingLogic".

    • Valid After – Set it based on guidelines in your project, or now, for test purposes, simply use January 1st of the actual year.

    • Status – Select Active.

  3. Add a new element. Open the logic and set the following:

    • Type – Groovy (Function)

    • Name – "TrainingCustomField"

    • Display ModeEverywhere
      Caution: Rremember to uncheck the option Never.

    • Format Type Money

    • Enter this code:

      Groovy
      12.3
      
  • Save the logic.

    inherited logic with custom field
  1. Test the calculation.

    1. Recalculate your Live Price Grid.

    2. Review the value in column TrainingCustomField.

      lpg with custom field

Check Tips on Logic Customization for more details on configuring test LPG.

Modify/Override Behavior of Existing Field

When you open your logic Training_PSP_PricingLogic, there is an element named Cost.

  1. Find and edit your generic logic Training_PSP_PricingLogic.

    1. Select the element Cost.

    2. Comment out the original code.

    3. At the very beginning of the element code, insert your own implementation:

      Groovy
      return 100.0
      
    4. Save the logic.

  2. Test the calculation.

    1. Recalculate your Live Price Grid.

    2. Review the value in column Cost.

      lpg with custom cost