---
schema_version: "1"
id: a2364713c9a058d45b9f87c2dca2e40684806d743ec21cd016227a182c7f5cbd
title: Context Scopes
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_context_scopes.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_context_scopes.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 5190fc39ab51b2817e9ae56eacb2d322353281e6555c135f24182c3335aab81c
description: Context scopes describe the relational path from a root sObject, such as an Order, to related sObjects. Context mappings use context scopes to identify the fields on the sObjects or computed data that is matched with context dimension variables. The Context Rule Service evaluates the information.
products:
  - Communications
  - Media
  - Energy and Utilities
release: "264"
---
# Context Scopes

Context scopes describe the relational path from a root sObject, such as an Order, to related sObjects. Context mappings use context scopes to identify the fields on the sObjects or computed data that is matched with context dimension variables. The Context Rule Service evaluates the information.

![Context scopes are one of several context rule components.](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_scopes.jpg)

The following root context scopes are supported:

- Order
- Opportunity
- Quote
- Asset\*
- Any

\*You can only use the Asset scope for rules invoked during repricing.

Each of these scopes can then reference account and contract scopes.

**Root and Second-Level Context Scopes**

![Root context scopes are Order, Opportunity, Quote, and Asset. Second-level context scopes are Account and Contract. Each root scope can reference either second-level scope.](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/sobject_context_scopes.jpg)

For more information about the any context scope, see [Any Context Scope](https://help.salesforce.com/s/articleView?id=ind.comms_any_context_scope.htm&release=264.0.0&type=5 "The any context scope enables you to create context mappings that can be used across all root context scopes. For example, instead of creating separate context mappings to evaluate the status field across orders, quotes, and opportunities, you can use any context scope to evaluate the status for all root entities, including orders and quotes. You can also specify any as the entity for second-level context scopes, enabling you to evaluate information in accounts and contracts across all root entities.").

## Types of Context Scopes

Most context rules use an Entity context scope type. Entity context scopes refer to specific sObjects entities such as Order, Quote, and Asset.

As of CME Summer '18, context rules for pricing adjustments must use a Virtual context scope type. You use virtual context scopes to map to data entered by users at run time, which is stored only in memory.

## Creating Context Scopes

If context scopes are not defined in your environment, you must define them before creating context rules. For instructions about how to create context scopes, refer to [Creating Context Scopes](https://help.salesforce.com/s/articleView?id=ind.comms_creating_context_scopes.htm&release=264.0.0&type=5 "If context scopes have not been created in your environment, you must create them before defining context rules. This process is performed once as part of the initial context rule setup.").

- **[Creating Context Scopes](https://help.salesforce.com/s/articleView?id=ind.comms_creating_context_scopes.htm&release=264.0.0&type=5)**  
    If context scopes have not been created in your environment, you must create them before defining context rules. This process is performed once as part of the initial context rule setup.
- **[Virtual Context Scopes](https://help.salesforce.com/s/articleView?id=ind.comms_virtual_context_scopes.htm&release=264.0.0&type=5)**  
    Starting in Summer '18, virtual context scopes enable you to create context mappings to virtual objects. Virtual context scopes and virtual objects enable you evaluate data entered by the user at run time that is stored only in memory, such as pricing adjustment data. The Summer '18 release contains one supported virtual object, AdjustmentData, that is used for context rules for pricing adjustments.
- **[Any Context Scope](https://help.salesforce.com/s/articleView?id=ind.comms_any_context_scope.htm&release=264.0.0&type=5)**  
    The `any` context scope enables you to create context mappings that can be used across all root context scopes. For example, instead of creating separate context mappings to evaluate the status field across orders, quotes, and opportunities, you can use `any` context scope to evaluate the status for all root entities, including orders and quotes. You can also specify `any` as the entity for second-level context scopes, enabling you to evaluate information in accounts and contracts across all root entities.