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
          Plugin Contract

          Plugin Contract

          A plugin is a Javascript file that you can use to create special components such as a pricing engine for complex pricing.

          Required Editions

          Available in: Enterprise, Performance, and Unlimited Editions

          The plugin contract represents and manages plugins within the app model. This contract contains Javascript in the CDATA block. The framework creates a runtime artifact (a Javascript file) that is included in the deployment package. You can use the classname.function and objects defined in the Javascript file in different business logic files.

          By default, these two plugin contracts are available in $workspace/src/Plugins in Modeler:

          • BLConstants
          • ComplexPricingEngine

          You can use plugin contracts as read-only; you cannot modify plugin contracts. If you attempt to modify the plugin contract a validation warning message appears during the build process. However, you can create business logic files to use the user exits available in the ComplexPricingEngine for customization purposes. For example, create a business logic for the UserExitSkipCurrentCalcStep user exit. This business logic function is invoked whenever a calculation is run and passes a boolean flag to the user to skip the calculation step.

          Here’s a sample business logic function that uses UserExitSkipCurrentCalcStep:

           * @function UserExitSkipCurrentCalcStep
           * @this ComplexPricingEngine
           * @kind plugin
           * @namespace CUSTOM
           * @param {Object} OrderAttributes
           * @param {Object} UserExitId
           * @param {Object} VariantAttributes
           * @param {Object} ProductAttributes
           * @returns SkipCalcStep
           */
          function UserExitSkipCurrentCalcStep(OrderAttributes :Object, UserExitId :Object, VariantAttributes :Object, ProductAttributes :Object){
              var me :ComplexPricingEngine = this;
          
          //////////////////////////////////////////////////////// 
          // Add your customizing javaScript code below. //     
          ////////////////////////////////////////////////////////
          
          
          //////////////////////////////////////////////////////// 
          //Add your customizing javaScript code above.  //     
          //// ///////////////////////////////////////////////////
          
              return SkipCalcStep;
          }
          
          • 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.
           
          Loading
          Salesforce Help | Article