---
schema_version: "1"
id: abe406752bbd82be7c5180302c58df70f919c28c294acab4247af09a797701aa
title: Penalty Rules for Contracts
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_contracts.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_penalty_rules_for_contracts.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f514b7c9508a2b4da4c0b0325f734960b0c2c7a46ab183ef619e25bc52139236
description: To apply a penalty charge when an asset that is covered by an active contract is deleted or disconnected using Industries Cart, define a penalty rule. The contractual asset must be a root asset and not a child asset.
products:
  - Communications
  - Media
  - Energy and Utilities
release: "264"
---
# Penalty Rules for Contracts

To apply a penalty charge when an asset that is covered by an active contract is deleted or disconnected using Industries Cart, define a penalty rule. The contractual asset must be a root asset and not a child asset.

![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

Industries Cart doesn’t fully implement penalty rules. Custom configuration is required to provide a penalty notification message to the user at run time.

To use penalty rules for assets associated with contracts, you must perform setup steps in addition to creating a penalty rule and setting up the context rules framework.

1. Set up the ContractTerminationService interface:
    1. From the App Launcher, search for and open Interface Implementations.
    2. Click **New**.
    3. On the New Interface Implementation Detail page, enter the details for the ContractTerminationService interface.
        
        - **Interface Name** is ContractTerminationService.
        - **Active Implementation Class** must remain empty. When you specify an active implementation for this interface, the system automatically enters this information.
        - **Description** is a brief description of what the interface does.
    4. Save your work.
2. Set up the ContractTerminationService Interface implementation:
    1. Go to the **Interface Implementations** tab.
    2. From the **View** picklist, select **All**.
    3. Click **Go**.
    4. Click the **ContractTerminationService** interface. Click the interface name link, not the **Edit** link next to the interface name link.
    5. Click **New Interface Implementation Detail**.
    6. On the New Interface Implementation Detail page, create the ContractTerminationService interface.
        
        - **Available Implementation** is ContractTerminationService.
        - Select **Active** to set the new implementation as the active implementation for this interface.
        - Select **Default** to set the new implementation as the default implementation for this interface.
3. Version the MACD/FDO OmniScript:
    1. From the App Launcher, search for and open Omniscripts.
    2. Search for **MACD**.
    3. Click **MACD/FDO**.
    4. Click the latest version.
    5. Click **Create Version**.
4. Add a remote action to the Omniscript to run the `ContractTerminationService.changeToOrder` implementation:
    1. Drag and drop **Remote Action** from Available Components to the structure of the Omniscript after the CreateFDO step.
    2. Enter the following details for the remote action:
        
        - **Remote Class** is ContractTerminationService.
        - **Remote Method** is changeToOrder.
    3. Under Extra Payload, click **Add New Key/Value Pair**.
    4. Add the following keys:
        
        <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
                <colgroup>
                  <col>
                  <col>
                </colgroup>
                <thead class="slds-text-title_caps ">
                  <tr class="">
                    <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d123960e352">
                      <p style="margin-bottom:0;">Key</p>
                    </th>
                    <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d123960e358">
                      <p style="margin-bottom:0;">Description</p>
                    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr class="">
                    <td data-label="Key" class="slds-cell-wrap" style="vertical-align:top;" headers="d123960e352 ">
                      <p style="margin-bottom:0;">
                        <kbd>assetQueryString</kbd>
                      </p>
                    </td>

                    <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d123960e358 ">
                      <p style="margin-bottom:0;">Enter a value to query the assets. Before the query is run, the string isn't validated by the <code>ContractTerminationService</code> Apex class. We recommend ensuring that the string is correct.</p>
                    </td>

                  </tr>
                  <tr class="">
                    <td data-label="Key" class="slds-cell-wrap" style="vertical-align:top;" headers="d123960e352 ">
                      <p style="margin-bottom:0;">
                        <kbd>cancelDate</kbd>
                      </p>
                    </td>

                    <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d123960e358 ">
                      <p style="margin-bottom:0;">The date on which you want the promotion to be canceled. If you don't specify this value, the current date is automatically specified using <code>Date.today()</code>.</p>
                    </td>

                  </tr>
                  <tr class="">
                    <td data-label="Key" class="slds-cell-wrap" style="vertical-align:top;" headers="d123960e352 ">
                      <p style="margin-bottom:0;">
                        <kbd>cancellationReason</kbd>
                      </p>
                    </td>

                    <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d123960e358 ">
                      <p style="margin-bottom:0;">The reason for the cancellation that is added to all canceled promotions.</p>
                    </td>

                  </tr>
                  <tr class="">
                    <td data-label="Key" class="slds-cell-wrap" style="vertical-align:top;" headers="d123960e352 ">
                      <p style="margin-bottom:0;">
                        <kbd>accountId</kbd>
                      </p>
                    </td>

                    <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d123960e358 ">
                      <p style="margin-bottom:0;">Specifies the account ID used to create the future dated order (FDO). This key isn't used to query the assets. It’s instead used when creating the FDO.</p>
                    </td>

                  </tr>
                </tbody>
              </table>
5. Add a remote action to run the `ContractTerminationService.submitOrder` implementation:
    1. Drag and drop **Remote Action** from Available Components to the structure of the Omniscript after the remote action that you added in the previous step.
    2. Enter the following details for the remote action:
        
        - **Remote Class** is ContractTerminationService.
        - **Remote Method** is submitOrder.
    3. Under Extra Payload, click **Add New Key/Value Pair**.
    4. In the Key field, enter orderIds.
    5. In the Value field, enter the list of created FDO IDs.
6. Delete actions in the Omniscript that aren’t required including: **CreateFDO**, **Done Action 1**, and **Done Action 2**
7. Save the changes to the Omniscript:
    1. Under Structure, click **Script Configuration**.
    2. Click **Save**.
    3. Click **Activate Version**.
8. Create object level rules for contracts. For more information about object level rules, see [Creating Object Level Rules](https://help.salesforce.com/s/articleView?id=ind.comms_create_object_level_rules.htm&release=264.0.0&type=5 "Object level rules are used by the ContractTerminiationService interface to assign penalty rules for contracts.").
9. To use penalty rules for contracts, select a root-level asset and begin the asset-based ordering process in Industries Cart. In the order, delete the asset and submit the order. After the order is submitted, the contract cancellation penalty appears in Order Pricing.
    
    ![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
    
    Custom configuration is required to provide the user with a cancellation penalty notification message in Industries Cart.
    
    You create penalty rules in Vlocity Product Console using reusable context rule components. 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.")