Use Case: A Rule to Set the Price of a Maintenance Charge Based on the Software Price
This use case shows you how to use a calculated valuePric in a rule that will set the price of the Maintenance Product to be 20% of the Software Product on the quote.
Set up the Products for the Use Case
- In Zuora, add a custom field to the Product object:
- Name: ProductCategory
- API Name: ProductCategory__c
- Type: Text
- Create two products and their rate plans in Product Catalog.
- Set the ProductCategory field of the first product to Software.
- Set the ProductCategory field of the second product to Maintenance.
- In Zuora Quotes, create a custom field to the Product object with the same API name and type as in Step #1 above.
- In Zuora, run a Product Catalog sync.
Create the Rule
- In the Rules tab, click New and add the following rule.
- Rule Name: Maintenance Price Set to 20% of Software Price
- Active: Select the field.
- Define a Condition that checks if a Software Product exists on the quote.
- In the CONDITION section, click Add Criteria....
- In the first Attribute Type field, click and select Rollup Value.
- In the Object field, click and select Rate Plan.
- In the Rollup Type field, click and select Count.
- In the Filter field, click to create a Filter Condition that selects the products of the Software category.
- Click New Filter.
- In the Filter field, specify a filter name.
- In the first Attribute Type field, click and select Object Field Value.
- In the Object Field field, click -Select Field-.
- In the Rate Plan Field field, click and select Product>.
- In the Product Field field, click and select ProductCategory.
- Click Select.
- In the second Attribute Type field, click and select Static Value.
- In the Value field, type Software.
- Click Create and click Select.
- In the second Attribute Type field, click and select Static Value.
- In the Value field, type 1.
- Define the Action that sets the Effective Price of the Maintenance charge to the 20% of the Software price.
- In the ACTIONS section, click Add Action....
- In the Action Type field, click and select Update Product.
- In the Object field, click and select Charge.
- In the Field field, click and select Effective Price.
- In the Filter field, click to create a Filter Condition that selects the products of the Maintenance category.
- Click New Filter.
- In the Filter field, specify a filter name.
- In the Charge Field field, click and select Quote Rate Plan >.
- In the Quote Rate Plan field, click and select Product>.
- In the Product field, click and select ProductCategory.
- Click Select.
- In the second Attribute Type field, click and select Static Value.
- In the Value field, type Maintenance.
- Click Create and click Select.
- In the New Value Type field, click and select Calculated Value.
- In the Calculated Value field, click -Select Value- to define a formula to calculate 20% of the Software price.
- In the Object Type filed, click and select Quote.
- In the Calculated Value field, type a name for this Calculated Value.
- Click New Calculated Value.
- Click Add Input.
- In the Input Type field, click and select Rollup Value.
- In the Object field, click and select Charge.
- In the Rollup Type field, click and select Sum.
- In the Filter field, click to create a new Filter that selects the products of the Software category.
- In the Filter field, specify a unique filter name.
- Click New Filter.
- In the first Attribute Type field, click and select Object Field Value.
- In the Object Field field, click to create a new filter on the Charge object.
- In the Charge Field field, click and select Quote Rate Plan.
- In the Quote Rate Plan Field field, click and select Product>.
- In the Product Field field, click and select ProductCategory.
- Click Select.
- In the second Attribute Type field, click and select Static Value.
- In the Value field, type Software.
- Click Create and click Select.
- In the Object Field field, click and select Effective Price.
- In the second Input Type field, click and select Static Value.
- In the Value field, type 0.2.
- Click Create and click Select.
- In the Message field, type "Support Charge updated."
- Click Save.
Verify the Rule
- Create a new quote of the New Subscription type.
- Add the two products and rate plans in the Enhanced Guided Selling flow.
- Verify that the Effective Price of the Maintenance product is 20% of the total price of the Software product.
- The Rules Engine Logs section will show the message you specified in the rule, "Support Charge updated."