Loading
Feature degradation | Gmail Email delivery failureRead More
Public Sector Documentation
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
          Automatically Calculate Application Fees

          Automatically Calculate Application Fees

          Use Business Rules Engine to automatically calculate processing fees associated with business license applications.

          Required Editions

          View supported product editions.
          User Permissions Needed
          To create decision matrices: Rule Engine Designer
          To create, update, and delete expression sets: Rule Engine Designer

          Configure a decision matrix and expression set to determine an application fee amount based on the authorization category and type that the constituent enters in the Omniscript license application form. For example, automatically charge a base fee of $100 for a barber’s license application and $150 for a salon establishment license application.

          Create Decision Matrices for an Application

          Create a decision matrix that calculates a fee for an application.

          A decision matrix is a table that includes input values in one column and output values in another column. When an expression set calls a decision matrix, it finds the table row that matches the input values, and returns that row's output values. It's easy to change conditions in a decision matrix so that your agencies and departments can keep pace with ever-changing rules and policies.

          Now that we've created an application form for our constituent to request a license for her in-home salon, it's time to create the decision matrices for the business rule that will determine the application fee. We create decision matrices to calculate a basic application fee and a premium (percentage-based) fee.

          1. From the App Launcher (App Launcher icon), find and select Business Rules Engine.
          2. From the app navigation menu, select Lookup Tables.
          3. Click New, select Decision Matrix, and then click Next.
            First, let's create the matrix used to calculate the base fee.
          4. For Name, enter CMBase Fee, and for Type, select Standard.
          5. Save your work.
          6. On the record page for your new decision matrix, on the Related tab, click version 1 of the matrix.
          7. Add columns to define your input and output data. Use this table to create a decision matrix and name it CMBase Fee, to calculate a base fee based on values that the constituent enters in the AuthorizationCategory and AuthorizationType fields of the license application form.
            Input Data Output Data
            AuthorizationCategory (Text) AuthorizationType (Text) BaseFee (Currency)
            License Barber's License 100
            License Salon Establishment License 150
            Permit Temporary Promo Event Permit 50
          8. Create another decision matrix and call it CMPremiumFee, to calculate a premium, percentage-based fee based on values that the constituent enters in the AuthorizationCategory and Application Category fields of the application form.
            Input Data Output Data
            AuthorizationCategory (Text) Application Category (Text) PercentageFee (Percent)
            License Special 20
            Permit Special 30

          Build an Expression Set for the Business Rule

          Create an expression set that calculates a fee for an application using a lookup table and variables.

          Expression sets are the calculation engine of business rules. They consist of a series of steps, connected in a logical flow, built from variables, constants, and decision matrices.

          Configuring an expression set is a multistep process. First, you create a usable version of your expression set. Then, you create variables and constants for inputs, outputs, and values that are used by and passed between the steps. Next, you add a logical sequence of steps that perform calculations or evaluate conditions using variables, constants, and decision matrices. After you’ve created a flow, you simulate your expression set with test values to verify that it's working as expected and then, finally, you activate the expression set.

          Let's create an expression set now that calculates the application fee for our salon-owner constituent based on the values they enter in the application form and the conditions defined in our decision matrices.

          1. From the App Launcher (App Launcher icon), find and select Business Rules Engine.
          2. Click the app navigation menu and select Expression Sets.
          3. Click New.
          4. For Name, enter Fee_Calculation, and then save your work.
          5. On the record page for your new expression set, on the Related tab, clicks the action menu for the expression set version and select Open in Expression Set Builder.
          6. Create the variables for the expression set.
            1. Click Resource Manager icon, and then click Add Resource.
            2. Specify these options.
              • For Resource Type, select Variable.
              • For Name, enter Base_Fee.
              • For Data Type, select Currency.
              • For Default Value, enter 0.
            3. Click Done And New.
            4. Specify these options.
              • For Resource Type, select Variable.
              • For Name, enter CMBaseFee_BaseFee.
              • For Data Type, select Currency.
              • For Default Value, enter 0.
            5. Click Done And New.
            6. Specify these options.
              • For Resource Type, select Variable.
              • For Name, enter Premium_Fee.
              • For Data Type, select Currency.
              • For Default Value, enter 0.
            7. Click Done And New.
            8. Specify these options.
              • For Resource Type, select Variable.
              • For Name, enter CMPremiumFee_PercentageFee.
              • For Data Type, select Percent.
              • Click Done.
          7. Add elements to the expression set to calculate the base fee.
            1. Click Add Element icon in the Expression Set canvas and select Lookup Table. In the Lookup Table Details field, search for and select CMBaseFee. Then, click Element Details icon and name the element Get Base Fee.
            2. Click Add Element icon in the Expression Set canvas and add a Calculation element after the Get Base Fee step. For Formula, enter CMBaseFee_BaseFee. For Output Variable, select Base_Fee. In the Element Details panel, name the calculation Set Base Fee and select Include in Output.
          8. Add a Conditional Group to the expression set to calculate the premium fee.
            1. Click Add Element icon in the canvas and add a Conditional Group element after the Set Base Fee step.
            2. In the placeholder Condition element, click in the expression field, add ApplicationCategory, and complete the expression by adding == 'Special'. Be sure to include spaces around the operator. The final expression looks like this: ApplicationCategory == 'Special'.
            3. Click Add Element icon after the Condition and add a Lookup Table to the Conditional Group. Search for and select CMPremiumFee.
            4. Click Add Element icon after the Decision Matrix and add a Calculation to the Conditional Group. For Formula, enter Base_Fee * CMPremiumFee_PercentageFee. For Output Variable, select Premium_Fee. In the Element Details panel, name the calculation element Compute Premium Fee and select Include in Output.
          9. Save your work.

          Before activating your expression set, run simulations with default and custom test input variables. If the expression set doesn't work as expected, edit the elements and simulate again. When you're satisfied, activate it.

           
          Loading
          Salesforce Help | Article