---
schema_version: "1"
id: 61ae731f56483a14893638140fafceb0cf90de7c57998c8dc5c2b1a4a01ee644
title: Penalty Rules for Promotions
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_penalty_rules_for_promotions.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_penalty_rules_for_promotions.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: cbd7049c040a5551412ca2b4ee005d47f001ce232eaa5ea4f387323a0b174f73
description: To apply a penalty amount when a promotion is canceled in the Industries Cart, use context rules with the rule type, Penalty. Penalty rules apply only when promotions are canceled during a move, add, change, or delete operation or in asset-based orders. Penalty rules are applied when one or more penalty conditions are met.
products:
  - Communications
  - Media
  - Energy and Utilities
release: "264"
---
# Penalty Rules for Promotions

To apply a penalty amount when a promotion is canceled in the Industries Cart, use context rules with the rule type, Penalty. Penalty rules apply only when promotions are canceled during a move, add, change, or delete operation or in asset-based orders. Penalty rules are applied when one or more penalty conditions are met.

## Prerequisites to Set Up Org for Penalty Rules

Verify that the following settings are configured in your organization before setting up penalty rules. See [Configure Your Org to Use Context Rules](https://help.salesforce.com/s/articleView?id=ind.comms_t_configure_your_org_to_use_context_rules_58449.htm&language=en_US) for details on how to configure the following settings.

- Context rules are enabled.
- Cache is enabled.
- Trial storage allocation for the platform cache, named **CPQ Partition**, is set.
- `CtxRulesProductsOpenImplementation` interface implementation is activated.
- If you use the function condition in the rule, then make sure that an apex class is deployed and the function definition in Custom Metadata types is set.

## Set Up Penalty Rules

Penalty rules are created in the Vlocity Product console using the same context rule components as qualification context rules.

1. Create a penalty rule.
    
    See [Creating a Penalty Rule](https://help.salesforce.com/s/articleView?id=ind.comms_create_a_penalty_rule.htm&release=264.0.0&type=5 "Create penalty rule sets in Vlocity Product Console using reusable context rule components.").
    
    1. Don’t include spaces in the Context Dimension name, Rule Condition Code, and Rule Code.
    2. Don’t include spaces, "-", and "\_" in the Function name.
    3. When defining a custom expression, use spaces to delimit each element. For example: `( Rule1Code OR Rule2Code ) AND Rule3Code`
        
        1. Use one space between parenthesis and code.
        2. Match code exactly because code is case-sensitive.
        3. Use`AND` and `OR` exactly.
        4. Don’t use unsupported characters: &&, ||, and, or, And, Or.
    4. Set up the Data Type of Context Dimension correctly and use text instead of string.
    5. Ensure that condition weight in dimension is <= 30.
    6. Ensure that the Context Dimension name isn’t a function name.
    7. To get context from a field from custom object, such as, **ContractTerm** field from the **vlocity\_cmt\_\_ContractId\_\_c** in **Asset** Object, use \_\_r instead of \_\_c (`Asset.ContractId__r.ContractTerm)`.
2. Create a rule condition for the penalty rule.
    
    See [Creating a New Rule with Simple Condition](https://help.salesforce.com/s/articleView?id=ind.comms_using_context_rules_to_check_user_s_eligibility_in_self_service_transactions.htm&release=264.0.0&type=5 "The following configurations enable you to evaluate the eligibility of the logged-in user for self-service transactions:").
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/images/icon_note.png)
    
    Note
    
    Penalty is applied when the specified condition is true and the Fail Level = Hard Fail.
    
    Here’s an example.
    
    ![Rule condition for a penalty rule](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/rule_condition_for_penalty_rule.png)
3. Create a pricing element charge.
    
    See [Create a Pricing Element Charge or Adjustment in the Pricing Designer.](https://help.salesforce.com/s/articleView?id=ind.comms_create_a_pricing_element_charge_or_adjustment_in_the_pricing_designer.htm&release=264.0.0&type=5 "A pricing element has a one-to-one association with a pricing variable and defines the actual price or a reference to a pricing matrix which will be used to calculate the price during runtime. Pricing elements are reusable and can be attached to more than one product through the price list.")
    
    Here’s an example of a pricing element called Penalty20.
    
    ![Pricing element charge](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/price_element_charge.png)
4. Create a context action.
    
    See [Create Context Actions.](https://help.salesforce.com/s/articleView?id=ind.comms_create_context_actions.htm&release=264.0.0&type=5 "Use context actions with penalty rules to apply a fee when a promotion or contract is canceled. Context actions enable you to specify a flat fee using a pricing element on a price list.")
    
    Here’s an example of a context action called Penalty20.
    
    ![context action](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/context_action.png)
5. Create a rule set using these values.
    
    See also [Create a rule set.](https://help.salesforce.com/s/articleView?id=ind.comms_create_rule_sets.htm&release=264.0.0&type=5 "A rule set is a logical grouping of one or more context rules. A rule set enables you to designate how the grouped context rules are expressed in a logical expression and how they are used in Industries Cart. To create a rule set, you define general properties and then specify one or more context rules as child rules.")
    
    Enter these values:
    
    1. **Rule Type**: **Penalty**
    2. **Rule Purpose**: **Eligibility**
    3. **Expression Mode**: **If Else If** or **If**
    4. **Header Rule**: optional
6. Add a child penalty rule. In the child penalty rule,
    
    1. Set **Action Taken** to **Policy Action**.
    2. Select the **Context Action** that you created earlier.
        
        ![Child penalty rule](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/child_penalty_rule.png)
        
        You can add multiple rules with different actions. For example:
        
        **If** customer segment = B2B, apply penalty20,
        
        **Else if** customer segment = B2C, apply penalty10,
        
        **Else** (Always true rule), apply penalty30.
7. Apply the penalty rule set to a promotion.
    
    See [Penalty Rules - Assigning to a Promotion](https://help.salesforce.com/s/articleView?id=ind.comms_create_a_penalty_rule.htm&release=264.0.0&type=5 "Create penalty rule sets in Vlocity Product Console using reusable context rule components.").

## Cancel Promotions

See how to cancel a promotion in Industries Cart.

1. Go to the **Account** record detail -> **Assets** page.
2. Select the asset whose promotion you want to cancel.
3. Click **Change to Order**.
4. From the **Promotions** tab, select and cancel the relevant promotion.
    
    ![Cancel a promotion](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/cancel_promotion.png)
5. Enter a cancel date and a reason for cancellation, and then click **Evaluate**.
    
    ![Reason for canceling a promotion](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/reason_for_cancelation.png)
    
    If the cancellation initiates a penalty rule, the Cancel Promotion dialog shows you the penalty amount that’s levied if you cancel the promotion. You can cancel the promotion or keep it.
    
    ![Penalty rule is triggered](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/penalty_rule_triggered.png)
    
    If you choose to cancel, the promotion status changes to **Disconnect**.
    
    ![Promotion is disconnected](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/promotion_disconnected.png)
    
    The Order Pricing object (`vlocity_cmt__OrderPriceAdjustment__c`) keeps a record of the levied penalty and any reversed promotional pricing adjustments.
6. To see the penalty applied to an order, check **Order Pricing Detail**.
    
    ![Penalty under the Order Pricing object](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/penalty_under_order_pricing.png)