ContextUseCaseMapping

Represents the setup object that stores configuration details for the context service for Salesforce Contracts.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type 

This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location 

ContextUseCaseMapping components have the suffix .contextUseCaseMapping and are stored in the contextUseCaseMappings folder.

Version 

ContextUseCaseMapping components are available in API version 61.0 and later.

Special Access Rules 

Requires Context Service to be enabled in the organization. This metadata type is specifically designed for contract lifecycle management and is part of the broader Context Service architecture for Industries solutions.

Fields 

contextDefinition​Name 

Type: string

Description: Required. Name of the context definition that stores hydration and persistence mapping details. References a ContextDefinition component that describes the relationship between node structures within a context.

mappingName 

Type: string

Description: Required. Name of the mapping associated with the mapping type. Examples include OppToCntrHydrationMapping for hydration scenarios and OppToCntrPersistenceMapping for persistence scenarios.

mappingType 

Type: ContextMappingType (enumeration of type string)

Description: Required. Mapping type used for context use case mappings. Valid values are Hydration—Mapping type for data retrieval and population from source objects or Persistence—Mapping type for data storage and updates to target objects

masterLabel 

Type: string

Description: Required. User-friendly name for the context use case mapping that appears in the user interface.

referenceObject​Name 

Type: string

Description: The standard or custom source object that the context mapping is fetched from. This field represents the originating object for the mapping relationship.

referenceObject​RecordType 

Type: string

Description: The record types associated with the reference object. This field is used for record type-specific mapping configurations within the same object type. Available in API version 61.0 and later.

targetObject​CustomFieldName 

Type: string

Description: Name of the custom field in the target object used to link the target object with the reference object. This field must be a valid field in the target object and establishes the relationship between source and target objects.

targetObject​Name 

Type: string

Description: Name of the standard or custom object that the context mapping from the reference object is pushed to. This represents the destination object for the mapping relationship, typically the Contract object.

targetObject​RecordType 

Type: string

Description: The record types associated with the target object. This field is used for record type-specific configurations within the target object, typically associated with the Contract object.

useCaseType 

Type: ContextUseCaseType (enumeration of type string)

Description: Required. Type of use case that defines the purpose and scope of the context mapping. Valid values are:

  • ContractCreationOrUpdation—Use case for creating or updating contracts from source objects
  • ContractExtraction—Use case for extracting contract data for document generation or other processes

Declarative Metadata Sample Definition 

This is an example of a ContextUseCaseMapping component.

1<?xml version="1.0" encoding="UTF-8"?>
2<ContextUseCaseMapping xmlns="http://soap.sforce.com/2006/04/metadata">
3    <contextDefinitionName>TestDefName</contextDefinitionName>
4    <mappingName>TestMapName</mappingName>
5    <mappingType>Hydration</mappingType>
6    <masterLabel>TestMLabel</masterLabel>
7    <referenceObjectName>Opportunity</referenceObjectName>
8    <referenceObjectRecordType>TestOppRT</referenceObjectRecordType>
9    <targetObjectCustomFieldName>SourceOpportunityId</targetObjectCustomFieldName>
10    <targetObjectName>Contract</targetObjectName>
11    <targetObjectRecordType>TestOppRT</targetObjectRecordType>
12    <useCaseType>ContractCreationOrUpdation</useCaseType>
13</ContextUseCaseMapping>

This is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <fullName>TestPkg</fullName>
4    <types>
5        <members>Opportunity.TestSalesProcess</members>
6        <name>BusinessProcess</name>
7    </types>
8    <types>
9        <members>TestDName</members>
10        <name>ContextUseCaseMapping</name>
11    </types>
12    <types>
13        <members>Contract.ContractLifecycleManagement</members>
14        <members>Opportunity.TestOppRT</members>
15        <name>RecordType</name>
16    </types>
17    <version>68.0</version>
18</Package>

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.