Create rule to set price of maintenance charge based on software price
Learn how to use a calculated value in a rule to set the price of the maintenance product to be 20% of the software product on the quote.
- Perform the following steps to set up the products.
- 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 #a above.
- In Zuora, run a Product Catalog sync.
- In Zuora, add a custom field to the Product object:
- Perform the following steps to 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, click -Select Field-.
- In the 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 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 field, 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, click to create a new filter on the Charge object.
- In the Charge 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 Software.
- Click Create and click Select.
- In the Object 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.
- In the Rules tab, click New and add the following rule.
- Perform the following steps to 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 shows the message you specified in the rule, Support Charge updated.