---
schema_version: "1"
id: f49b6c672766e84217cc7178ddb0c540139f2a353a969714405ad9163352477d
title: Customize Routing Logic with Rule Groups
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/commerce/264-0-0/om_new_rule_group.md
canonical_url: https://help.salesforce.com/s/articleView?id=commerce.om_new_rule_group.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 97101c422ec2cde81d697d990190911e9594bc2f4a135c452aa775b6a78ea608
description: Control Order Management routing by creating and publishing groups of templated or custom rules.
products:
  - Commerce
  - Salesforce Order Management
release: "264"
---
# Customize Routing Logic with Rule Groups

Control Order Management routing by creating and publishing groups of templated or custom rules.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=commerce.om_editions.htm&amp;language=en_US" target="_blank">View supported editions</a>.</td></tr></tbody></table>

Before beginning this task, make sure the [Order Fulfillment Setup section](https://help.salesforce.com/s/articleView?id=commerce.om_enable_order_management_setup.htm&release=264.0.0&type=5 "The Order Fulfillment Setup section is the landing page for all components of Commerce Delivery Service (CDS).") is enabled.

Rules control how routing locations and routes are selected. There are two types of rules. A filter rule excludes locations. A weighted rule is multiplied against the scores of the locations that fit the rule's conditions. These scores are considered against the other weighted rules in the group. The routing logic selects the highest scored locations that weren’t filtered out.

Order Management has several templated rules, which can modify routing based on inventory availability, location proximity, markdown avoidance, overstock, and split optimization.

[Custom rules](https://help.salesforce.com/s/articleView?id=commerce.om_new_custom_rule.htm&release=264.0.0&type=5 "Custom rules modify routing by selecting locations based on any standard or custom attribute available on Order Management objects. Custom rules can filter out locations or select an ideal location by calculating condition-based scores.") can filter out locations or select an ideal location by calculating condition-based scores. You can create a custom rule only after you’ve created a rule group.

After you add rules to a group, you can configure start dates, end dates, and rule weights, where applicable. To prevent out-of-stock errors, all rule groups automatically contain the inventory availability rule.

You can have up to 20 active rule groups at one time. Each rule group can have up to 10 rules within them, and rules can have up to 15 conditions per rule. To increase these limits, contact Salesforce Customer Support.

1. In the Rule Management tab of Order Fulfillment Setup, click **New Rule Group**.
2. Enter a name, external reference, and description.
3. Select rules. You can modify these rules individually after you finish creating the group. To add a markdown avoidance rule, first [create a markdown avoidance rule](https://help.salesforce.com/s/articleView?id=commerce.om_create_markdown_avoidance.htm&release=264.0.0&type=5 "A markdown avoidance reduces the risk of products selling at a discounted price by shipping products from locations at risk of future discounts. To implement a markdown avoidance, create a markdown avoidance rule in the Markdown Avoidance tab, sync it, and then add it to a rule group.") in the Markdown Avoidance tab and sync it before adding it to a group.
4. Set the maximum number of locations orders can split to. If you turn off split optimization, Order Management doesn’t consider splits when routing orders.
5. Click **Save**.
6. Edit an individual rule.
    1. Click the action menu for the rule and select **Edit**.
    2. Edit the rule name, description, start and end date, and weight as needed.
    3. Click **Save**.
7. When you’re ready to publish your group, click **Publish**.

#### See Also

- [Routing via Rules](https://help.salesforce.com/s/articleView?id=commerce.om_routing_rules_overview.htm&release=264.0.0&type=5 "Use rule groups to modify routing logic directly in the Order Management UI instead of using code or Salesforce Flow.")
- [Create a Custom Routing Rule](https://help.salesforce.com/s/articleView?id=commerce.om_new_custom_rule.htm&release=264.0.0&type=5 "Custom rules modify routing by selecting locations based on any standard or custom attribute available on Order Management objects. Custom rules can filter out locations or select an ideal location by calculating condition-based scores.")
- [Create a Markdown Avoidance Rule](https://help.salesforce.com/s/articleView?id=commerce.om_create_markdown_avoidance.htm&release=264.0.0&type=5 "A markdown avoidance reduces the risk of products selling at a discounted price by shipping products from locations at risk of future discounts. To implement a markdown avoidance, create a markdown avoidance rule in the Markdown Avoidance tab, sync it, and then add it to a rule group.")