ContextDefinition
Parent Type
File Suffix and Directory Location
ContextDefinition components have the suffix .contextDefinition and are stored in the contextDefinitions folder.
Version
ContextDefinition components are available in API version 59.0 and later.
Special Access Rules
Enable the organization preference ContextDefinitionsEnabled to access the ContextDefinition metadata type.
Fields
| Field Name | Description |
|---|---|
| canBeReferenceDefinition |
|
| clonedFrom |
|
| contextDefinitionReferences |
|
| contextDefinitionVersions |
|
| contextTtl |
|
| description |
|
| hasSystemTags |
|
| inheritedFrom |
|
| inheritedFromVersion |
|
| isProtected |
|
| masterLabel |
|
| title |
|
ContextDefinitionReference
Represents details about the context definition reference.
| Field Name | Description |
|---|---|
| inheritedFrom |
|
| referenceContextDefinition |
|
ContextDefinitionVersion
Represents details about the context definition version. Only one version can be active at a time.
| Field Name | Description |
|---|---|
| contextMappings |
|
| contextNodes |
|
| endDate |
|
| isActive |
|
| startDate |
|
| versionNumber |
|
ContextMapping
Represents the mapping of attributes and nodes to related objects.
| Field Name | Description |
|---|---|
| contextMappingIntents |
|
| contextNodeMappings |
|
| default |
|
| description |
|
| inheritedFrom |
|
| title |
|
ContextMappingIntent
Represents the purpose associated to a context mapping.
| Field Name | Description |
|---|---|
| mappingIntent |
|
ContextNodeMapping
Represents the relationship between the node in the context and values in the input schema.
| Field Name | Description |
|---|---|
| contextAttributeMappings |
|
| contextNode |
|
| contextNodeAttrDictionaries |
|
| inheritedFrom |
|
| mappedContextDefinition |
|
| object |
|
ContextAttributeMapping
Represents the relationship between the attributes defined in the context and the values in the related objects.
| Field Name | Description |
|---|---|
| contextAttrHydrationDetails |
|
| contextAttribute |
|
| contextInputAttributeName |
|
| ctxAttrHydrationCtxs |
|
| inheritedFrom |
|
ContextAttrHydrationDetail
Represents the SOQL (database) queries that fetch data for a chosen attribute from the input schema.
| Field Name | Description |
|---|---|
| contextAttrHydrationDetails |
|
| inheritedFrom |
|
| objectName |
|
| queryAttribute |
|
CtxAttrHydrationCtx
Represents the queries that fetch data for a chosen attribute from the input schema for context-to-context mapping.
| Field Name | Description |
|---|---|
| contextQueryAttribute |
|
| inheritedFrom |
|
ContextNodeAttrDictionary
Represents the relationship between a context node and the context attribute dictionary.
| Field Name | Description |
|---|---|
| contextAttrDictIdentifier |
|
| contextNodeTagPrefix |
|
ContextNode
Represents details of the structure of the nodes within the context. Each node can have other nodes related to them and attributes to describe the object. You can also define a hierarchy for the nodes.
| Field Name | Description |
|---|---|
| canonicalNode |
|
| contextAttributes |
|
| contextNodeAttrDictionaries |
|
| contextTags |
|
| displayName |
|
| inheritedFrom |
|
| title |
|
| transposable |
|
ContextAttribute
Represents details of an attribute used to describe a context node. Each node can have one or many associated attributes.
| Field Name | Description |
|---|---|
| contextTags |
|
| dataType |
|
| description |
|
| displayName |
|
| domainSet |
|
| fieldType |
|
| inheritedFrom |
|
| key |
|
| title |
|
| transient |
|
| value |
|
ContextTag
Represents a unique identifier of an attribute or node instead of a fully qualified tag structure name.
| Field Name | Description |
|---|---|
| title |
|
| inheritedFrom |
|
Declarative Metadata Sample Definition
The following is an example of a ContextDefinition component.
1<?xml version="1.0" encoding="UTF-8"?>
2<ContextDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
3 <fullName>Test</fullName>
4 <contextDefinitionVersions>
5 <contextMappings>
6 <contextNodeMappings>
7 <contextNodeAttrDictionaries>
8 <contextAttrDictIdentifier>Context Attribute Dictionary Name</contextAttrDictIdentifier>
9 <contextNodeTagPrefix>Context Node Tag Prefix</contextNodeTagPrefix>
10 </contextNodeAttrDictionaries>
11 <contextAttributeMappings>
12 <contextAttrHydrationDetails>
13 <objectName>CustomAccount__c</objectName>
14 <queryAttribute>Name</queryAttribute>
15 <inheritedFrom>StandardDefinition/version/CustomAccountMapping/Praneeth/AccountName/hydrationInfo-1</inheritedFrom>
16 </contextAttrHydrationDetails>
17 <ctxAttrHydrationCtxs>
18 <contextQueryAttribute>StandardDefinition</contextQueryAttribute>
19 <inheritedFrom>StandardDefinition/version/AccountMapping/Praneeth/AccountName/ctxToCtxhydrationInfo-1</inheritedFrom>
20 </ctxAttrHydrationCtxs>
21 <contextAttribute>AccountName</contextAttribute>
22 <contextInputAttributeName>AccountName</contextInputAttributeName>
23 <inheritedFrom>StandardDefinition/version/CustomAccountMapping/Praneeth/AccountName</inheritedFrom>
24 </contextAttributeMappings>
25 <contextAttributeMappings>
26 <contextAttrHydrationDetails>
27 <objectName>CustomAccount__c</objectName>
28 <queryAttribute>CustomAccountName__c</queryAttribute>
29 <inheritedFrom>StandardDefinition/version/CustomAccountMapping/Praneeth/CustomAccountName/hydrationInfo-1</inheritedFrom>
30 </contextAttrHydrationDetails>
31 <ctxAttrHydrationCtxs>
32 <contextQueryAttribute>StandardDefinition</contextQueryAttribute>
33 <inheritedFrom>StandardDefinition/version/AccountMapping/Praneeth/AccountName/ctxToCtxhydrationInfo-1</inheritedFrom>
34 </ctxAttrHydrationCtxs>
35 <contextAttribute>CustomAccountName</contextAttribute>
36 <contextInputAttributeName>CustomAccountName</contextInputAttributeName>
37 <inheritedFrom>StandardDefinition/version/CustomAccountMapping/Praneeth/CustomAccountName</inheritedFrom>
38 </contextAttributeMappings>
39 <contextNode>Praneeth</contextNode>
40 <object>CustomAccount__c</object>
41 <inheritedFrom>StandardDefinition/version/CustomAccountMapping/Praneeth</inheritedFrom>
42 <mappedContextDefinition>CustomContextDefinition</mappedContextDefinition>
43 </contextNodeMappings>
44 <contextMappingIntents>
45 <mappingIntent>hydration</mappingIntent>
46 </contextMappingIntents>
47 <default>true</default>
48 <title>CustomAccountMapping</title>
49 <inheritedFrom>StandardDefinition/version/CustomAccountMapping</inheritedFrom>
50 </contextMappings>
51 <contextMappings>
52 <contextNodeMappings>
53 <contextNodeAttrDictionaries>
54 <contextAttrDictIdentifier>Context Attribute Dictionary Name</contextAttrDictIdentifier>
55 <contextNodeTagPrefix>Context Node Tag Prefix</contextNodeTagPrefix>
56 </contextNodeAttrDictionaries>
57 <contextAttributeMappings>
58 <contextAttrHydrationDetails>
59 <objectName>Account</objectName>
60 <queryAttribute>Name</queryAttribute>
61 <inheritedFrom>StandardDefinition/version/AccountMapping/Praneeth/CustomAccountName/AccountName/hydrationInfo-1</inheritedFrom>
62 </contextAttrHydrationDetails>
63 <ctxAttrHydrationCtxs>
64 <contextQueryAttribute>StandardDefinition</contextQueryAttribute>
65 <inheritedFrom>StandardDefinition/version/AccountMapping/Praneeth/AccountName/ctxToCtxhydrationInfo-1</inheritedFrom>
66 </ctxAttrHydrationCtxs>
67 <contextAttribute>AccountName</contextAttribute>
68 <contextInputAttributeName>AccountName</contextInputAttributeName>
69 <inheritedFrom>StandardDefinition/version/AccountMapping/Praneeth/CustomAccountName/AccountName</inheritedFrom>
70 </contextAttributeMappings>
71 <contextAttributeMappings>
72 <contextAttrHydrationDetails>
73 <objectName>Account</objectName>
74 <queryAttribute>CustomAccountName__c</queryAttribute>
75 <inheritedFrom>StandardDefinition/version/AccountMapping/Praneeth/CustomAccountName/hydrationInfo-1</inheritedFrom>
76 </contextAttrHydrationDetails>
77 <ctxAttrHydrationCtxs>
78 <contextQueryAttribute>StandardDefinition</contextQueryAttribute>
79 <inheritedFrom>StandardDefinition/version/AccountMapping/Praneeth/AccountName/ctxToCtxhydrationInfo-1</inheritedFrom>
80 </ctxAttrHydrationCtxs>
81 <contextAttribute>CustomAccountName</contextAttribute>
82 <contextInputAttributeName>CustomAccountName</contextInputAttributeName>
83 <inheritedFrom>StandardDefinition/version/AccountMapping/Praneeth/CustomAccountName</inheritedFrom>
84 </contextAttributeMappings>
85 <contextNode>Praneeth</contextNode>
86 <object>Account</object>
87 <inheritedFrom>StandardDefinition/version/AccountMapping/Praneeth</inheritedFrom>
88 <mappedContextDefinition>CustomContextDefinition</mappedContextDefinition>
89 </contextNodeMappings>
90 <contextMappingIntents>
91 <mappingIntent>persistence</mappingIntent>
92 </contextMappingIntents>
93 <description>Account Mapping</description>
94 <default>false</default>
95 <title>AccountMapping</title>
96 <inheritedFrom>StandardDefinition/version/AccountMapping</inheritedFrom>
97 </contextMappings>
98 <contextNodes>
99 <contextNodeAttrDictionaries>
100 <contextAttrDictIdentifier>Context Attribute Dictionary Name</contextAttrDictIdentifier>
101 <contextNodeTagPrefix>Context Node Tag Prefix</contextNodeTagPrefix>
102 </contextNodeAttrDictionaries>
103 <contextAttributes>
104 <contextTags>
105 <title>AccountName</title>
106 <inheritedFrom>StandardDefinition/version/Praneeth/AccountName/AccountName</inheritedFrom>
107 </contextTags>
108 <dataType>string</dataType>
109 <fieldType>inputoutput</fieldType>
110 <key>false</key>
111 <title>AccountName</title>
112 <displayName>AccountName</displayName>
113 <description>Test Description</description>
114 <value>false</value>
115 <inheritedFrom>StandardDefinition/version/Praneeth/AccountName</inheritedFrom>
116 </contextAttributes>
117 <contextAttributes>
118 <dataType>string</dataType>
119 <fieldType>inputoutput</fieldType>
120 <key>false</key>
121 <title>CustomAccountName</title>
122 <value>false</value>
123 <displayName>CustomAccountName</displayName>
124 <description>Test Description</description>
125 <inheritedFrom>StandardDefinition/version/Praneeth/CustomAccountName</inheritedFrom>
126 </contextAttributes>
127 <contextTags>
128 <title>Praneeth</title>
129 <inheritedFrom>StandardDefinition/version/Praneeth/Praneeth</inheritedFrom>
130 </contextTags>
131 <title>Praneeth</title>
132 <transposable>false</transposable>
133 <inheritedFrom>StandardDefinition/version/Praneeth</inheritedFrom>
134 <canonicalNode></canonicalNode>
135 <displayName>Praneeth</displayName>
136 </contextNodes>
137 <endDate>2097-05-10 00:00:00</endDate>
138 <startDate>2023-05-10 00:00:00</startDate>
139 <versionNumber>1</versionNumber>
140 <isActive>true</isActive>
141 </contextDefinitionVersions>
142 <description>Test Description</description>
143 <contextTtl>10</contextTtl>
144 <inheritedFrom>StandardDefinition</inheritedFrom>
145 <inheritedFromVersion>1.0</inheritedFromVersion>
146 <clonedFrom>OriginalDefinition</clonedFrom>
147 <isProtected>false</isProtected>
148 <masterLabel>Test Label</masterLabel>
149 <title>TestTitle</title>
150 <displayName>TestTitle</displayName>
151</ContextDefinition>The following is an example package.xml that references the previous definition.
1<Package xmlns="http://soap.sforce.com/2006/04/metadata">
2 <types>
3 <members>Test</members>
4 <name>ContextDefinition</name>
5 </types>
6 <types>
7 <members>Account.CustomAccountName__c</members>
8 <name>CustomField</name>
9 </types>
10 <types>
11 <members>CustomAccount__c</members>
12 <name>CustomObject</name>
13 </types>
14 <version>64.0</version>
15</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.