---
schema_version: "1"
id: bd1a570f6e8c239cdcd15ed5bce2496d88b38aad962307eb38d74b26adeda705
title: Compatibility Rules
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_compatibility_rules.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_compatibility_rules.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 02fd5a12647334d83a22851d5cb07300ba8413141a65a3a704d0f8273dd8bbf5
description: Compatibility rules are also known as configuration rules or validation rules. Compatibility rules determine if a product combination is valid. Using compatibility rules, you can define that, when a product is added to the cart, related products are added with it. You can also automatically add, automatically remove, or recommend products based on other products in the cart.
products:
  - Communications
  - Media
  - Energy and Utilities
release: "264"
---
# Compatibility Rules

Compatibility rules are also known as configuration rules or validation rules. Compatibility rules determine if a product combination is valid. Using compatibility rules, you can define that, when a product is added to the cart, related products are added with it. You can also automatically add, automatically remove, or recommend products based on other products in the cart.

Compatibility rules run on Order Line Item objects—Opportunity Line Item, Quote Line Item, or Order Line Item. The rule actions involve product relationships.

Compatibility rules define the relationship between products to ensure that the correct combination of products is added to the cart. Compatibility rules use the ProductValidationInterface and associated implementations to execute definitions in the Product Relationship object. For more information about product relationships, see

The validation interface and implementation are triggered when products are added to an order. Compatibility rule implementations include:

- ValidationRulesFlowImplementation
    
    Use ValidationRulesFlowImplementation when using a flow with Compatibility Rules included.
- ValidationRulesImplementation
    
    Use ValidationRulesImplementation when using advanced Compatibility Rules, including those that should be run conditionally.
- ProductRelationshipValidationImpl (deprecated)
    
    Use ProductRelationshipValidationImpl when using standard Compatibility Rules with soft relationships— requires or excludes.

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

With the ValidationRulesImplementation, you must also use a flow that includes a custom action with the class name UnconditionalProductValidation.

For more information about interfaces and implementations, see the Interfaces, Implementations, and ServicesInterfaces, Implementations, and Services.

**Compatibility Rule Process Diagram**

![A Trigger Event invokes a ValidationRulesImpl class, which invokes a Flow containing Advanced Rules. Advanced Rules have Entity Filters and Conditional Actions.](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/compatibilityrulesdiagram.png)

Example compatibility rules include:

- VOIP requires Office Internet.
- Office Internet excludes Business Video Service when the download speed is less than 100 Mbps.
- Office Internet automatically adds free installation for high-priority accounts in California.
- VOIP requires Office Internet only if the customer doesn’t already have Office Internet.
- Automatically add an iPhone case when the customer adds two or more iPhones to the cart.

You can also create compatibility rules based on product attributes, for example, exclude Product B if Internet speed is less than 100Mbps. For more information about product attributes, see [Product Attributes](https://help.salesforce.com/s/articleView?id=ind.comms_product_attributes_in_epc.htm&release=264.0.0&type=5 "Product attributes define product characteristics and can be categorized. You can use attributes to filter products. Pricing is based on product attributes.").

Before you create a compatibility rule, you must create an entity filter that defines the conditions. The entity filter must be run on the same object type as the rule. For more information about entity filters, see

## Create a Compatibility Rule

Compatibility Rules determine if a product combination is valid. Using Compatibility Rules, you can define that, when a product is added to the cart, related products are added with it. You can also automatically add, automatically remove, or recommend products based on other products in the cart.

Compatibility Rules are also known as Configuration Rules or Validation Rules.

In the example, Gold accounts are automatically given a free case when they order an iPhone 6.

To create a Compatibility Rule:

1. Create the necessary Product Relationships. For more information, see [Create a Product Relationship](https://help.salesforce.com/s/articleView?id=ind.comms_create_a_product_relationship.htm&release=264.0.0&type=5 "You create product relationships to relate products to one another.").
    
    In this example, create a Product Relationship for the Apple iPhone 6 that automatically adds an iPhone case.
2. Create the necessary Entity Filters. For more information, see [About Build Rules and Entity Filters](https://help.salesforce.com/s/articleView?id=ind.comms_about_build_rules_and_entity_filters.htm&release=264.0.0&type=5 "Before building a Rule, you must create all of the associated Entity Filters, Rule Filters, and Rule Actions. Also, you must create all of the Rule Action procedures.")
    
    In this example, create an Entity Filter that returns the Gold accounts.
    
    - The **Entity Filter Name** is **Parent Order Account Gold**.
    - The **Filter on Object Name** is **Order Product<OrderItem>**.
    - **Active** is selected.
    - The **Type** is **Qualification**.
3. Create the necessary Entity Filter conditions. For more information, see [Entity Filters](https://help.salesforce.com/s/articleView?id=ind.comms_entity_filters_overview.htm&release=264.0.0&type=5 "Each rule may have an entity filter, which filters out the orders on which to run, and a rule action, which defines what the rule does. Therefore, entity filters are also called rule action filters or rule filters. Rules use entity filters to determine which items in an order are subject to the rule action. Rules can contain one filter or many filters, depending on the business logic that the rule implements. Filters are reusable. For example, as part of a promotion, you might create a filter to identify premises where the service activation date is 45 days or less. After a filter is created, it's available for use in any rule that requires it.").
    
    In this example, the condition finds the Gold accounts.
    
    - The **Type** is **Field**.
    - The **Field/Attribute Name** is **Order.Account.vlocity\_cmt\_vCustomerPriority**.
    - The **Operator** is **\=** (equal sign).
    - The **Value** is **Gold**.
4. Click the **Vlocity Rules** tab.
5. Click **New**.
6. Enter the following information:
    
    - **Rule Name** is the name of the Rule. Enter a descriptive name so you can easily remember what the Rule does.
    - From the **This defines** picklist, select the Rule type, for example, **Configuration**.
    - From the **Rule that applies to** picklist, select the object to which the Rule applies, for example, **Order Product<Order Item>**.
    - From the **And is** picklist, select if the rule is **Active** or **Inactive**.
    - In the **Description** field, enter a description of what the Rule does.
    
    ![Example rule for adding an iPhone case to an iPhone purchase.](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/salesforce_rulebuilder_addiphonecasegold.png)
7. Scroll down to the Filters and Actions section.
    
    ![The Filters list in the Rule Builder.](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/salesforce_filtersandactions_filters.png)
8. Click the **Filters** button.
9. In the Filters and Actions list, locate the Entity Filter. Click the **Add to Rule Filter** link to the right of the filter to add.
10. Click the **Actions** button.
11. In the Filters and Actions list, click the **Add to Rule Action** link to the right of the action to add.
12. Scroll to the top of the page and click **Save**.
    
    **Rule Builder, Compatibility Rule**
    
    ![The Vlocity Rule Builder shows a rule for adding an iPhone case to an iPhone purchase.](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/go_to_vlocity_rule_builder.png)

## Test a Compatibility Rule

You can test Compatibility Rules by adding products to the cart in the Opportunity, Order, or Quote Manager. You can create a new Opportunity, Order, or Quote from the appropriate Account and add items to the cart.

For example, ordering an iPhone 6 from a Gold Account should add a free case.

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

Before you can test Rules, you must ensure that Vlocity is using the appropriate interface implementation. For more information, see "Set an Implementation" in Interfaces, Implementations, and Services.

To test a Compatibility Rule:

1. Click the **Orders** tab.
2. Create a new Order.
3. On the Order detail page, scroll down to the Order Manager.
4. Add the product that should activate the Compatibility Rule.
5. Confirm that the appropriate message appears or action has been taken.