Loading
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Complex Pricing User Exits

          Complex Pricing User Exits

          User exits for plugins are similar to the Pre-, Post-, and Replace methods that are available for some core methods. For example, use a user exit to replace the code in a calculation step and modify the calculation process for the user.

          Required Editions

          Available in: Enterprise, Performance, and Unlimited Editions

          For the complex pricing engine plugin, these user exits are available:

          • UserExitSkipCurrentCalcStep
          • UserExitAffectCalculationResult
          • UserExitAffectCurrentConditionBase
          • UserExitSkipCurrentSearchStrategyStep

          Starting Winter ’25, you can customize the above mentioned user exits in Visual Studio Code based Modeler by using these template files:

          • MyUserExitComplexPricingEngine.UserExitAffectCurrentConditionBase.bl.js
          • MyUserExitComplexPricingEngine.UserExitAffectCalculationResult.bl.js
          • MyUserExitComplexPricingEngine.UserExitSkipCurrentCalcStep.bl.js
          • MyUserExitComplexPricingEngine.UserExitSkipCurrentSearchStrategyStep.bl.js

          To customize the user exit methods, copy the required template to $workspace/src/Plugins/ComplexPricingEngine and configure the default logic as necessary. You can find the user exit template files in the contractSnippets folder of your Modeler workspace. Existing users should update their Visual Studio Code based Modeler to Winter’25 or higher and then upgrade the workspace to get these templates.

          UserExitSkipCurrentCalcStep

          Use the UserExitSkipCurrentCalcStep user exit to skip a complete calculation step (for a single product if it’s a product-based step).

          Returns: Boolean value SkipCalcStep. Specifies whether to skip the step.

          Parameters
          Parameter Description Type
          OrderAttributes Attributes of current Order. Object
          UserExitId ID of user exit as defined in Calculation Schema. Object
          VariantAttributes Attributes V1-V6. Object
          ProductAttributes Attributes of the current item. For header steps, dictionary of all items. Object

          UserExitAffectCalculationResult

          Use the UserExitAffectCalculationResult user exit to modify all calculation variables after the calculation. You can edit base, value, result, and the current total in this step.

          Returns: Object AffectedResults, which contain all four effectible calculation values.

          Parameters
          Parameter Description Type
          OrderAttributes Attributes of current Order. Object
          UserExitId ID of user exit as defined in Calculation Schema. Object
          VariantAttributes Attributes V1-V6. Object
          AffectableResults Effectible calculation data. Object
          ProductAttributes Attributes of the current item. For header steps, dictionary of all items. Object
          CurrentCalcStepAttributes Current calculation step data. Object

          UserExitAffectCurrentConditionBase

          Use the UserExitAffectCurrentConditionBase user exit to change the calculation base and the scale base (if step is a scaled step) of the current calculation step.

          Returns: Object ModifiedBases, which contains the affected calculation base and the affected scale base.

          Parameters
          Parameter Description Type
          OrderAttributes Attributes of current Order. Object
          UserExitId ID of user exit as defined in Calculation Schema. Object
          CurrentCalcStepAttributes Details of the current calculation step. Object
          VariantAttributes Attributes V1-V6. Object
          ModifiedBase Contains Current Calc- and Scale-Base. Object
          CurrentTotal Object
          ProductAttributes Attributes of the current item. For header steps, dictionary of all items.

          UserExitSkipCurrentSearchStrategyStep

          Use the UserExitSkipCurrentSearchStrategyStep user exit to skip one step in a search strategy.

          Returns: Boolean value SkipSearchStep. Specifies whether to skip the current search strategy.

          Parameters
          Parameter Description Type
          OrderAttributes Attributes of current Order. Object
          UserExitId ID of user exit as defined in Calculation Schema. Object
          VariantAttributes Attributes V1-V6. Object
          ProductAttributes Attributes of the current item. For header steps, dictionary of all items. Object
           
          Loading
          Salesforce Help | Article