Create the GoodStudentDiscountCalculation Calculation Procedure (Managed Package)

For the managed package runtime, the GoodStudentDiscountCalculation calculation procedure calls the GoodStudentDiscountEligibility calculation matrix, which applies a 15% discount to a quoted amount for an Age between 16 and 24 and a GPA of 3.0 or greater.

Managed Package app icon This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

  1. From the Vlocity Calculation Procedures tab, click New.
  2. In the New Calculation Procedure window, choose Declarative, then click Next.
  3. In the Calculation Procedure Name box, type GoodStudentDiscountCalculation.
  4. Click Save. The record page for the new calculation procedure opens.
  5. If you don't see a GoodStudentDiscountCalculation V1 link, click the Related tab.
  6. Click the GoodStudentDiscountCalculation V1 link. This is version 1 of the calculation procedure.
  7. Click Add Variable to add the following variables:

    Name

    Data type

    Precision

    Birthdate

    Date

    (none)

    Age

    Number

    0

    GPA

    Number

    2

    QuoteAmount

    Currency

    2

    QuoteAmountAdjusted

    Currency

    2

  8. Click Add Constant to add the following constants:

    Name

    Data type

    Precision

    Value

    Discount

    Percent

    0

    15

    One

    Number

    0

    1

  9. Create the first step:
    1. Click Add Step and select Calculation.

    2. In the inputs field, type and then select the following series of elements:

      AGE ( Birthdate )

    3. In the outputs field, type and then select Age.

  10. Create the second step:
    1. Click Add Step and select Matrix Lookup.

    2. In the Matrix Name field, type and then select GoodStudentDiscountEligibility.

    Note that the matrix inputs and outputs are filled in for you.

  11. Create the third step:
    1. Click Add Step and select Calculation.

    2. In the inputs field, type and then select QuoteAmount.

    3. In the outputs field, type and then select QuoteAmountAdjusted.

    4. Check the Include in Calculation Output box.

  12. Create the last step:
    1. Click Add Step and select Calculation.

    2. In the inputs field, type and then select the following series of elements:

      QuoteAmount * ( One – Discount )

    3. Check the Conditional Step box.

    4. In the Enter Condition field, type and then select Qualified(GoodStudentDiscountEligibility).

    5. In the outputs field, type and then select QuoteAmountAdjusted.

    6. Check the Include in Calculation Output box.

    When you're done, the steps should look like this:

    Figure is described in the preceding text.
  13. Click Save Calculation Procedure. In the Save successful pop-up, click OK.
  14. Scroll to the top. If you don't see the Enabled checkbox, click Edit.
  15. Click the pencil icon to the right of the Enabled checkbox and check the box.
  16. Click Save.
  17. (Optional) Click the Simulation or Simulate tab and test the calculation procedure.