この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

ContextDefinition

コンテキスト内のノード構造間のリレーションを表現するコンテキスト定義の詳細を表します。

Salesforce の平等を重視する価値観に基づいて、可能な限り、非包括的な用語は変更しました。顧客の実装への影響を回避するために、一部の用語は変更されていません。

重要

親種別

Metadata メタデータ型を拡張し、その fullName 項目を継承します。

ファイルのサフィックスおよびディレクトリの場所

ContextDefinition コンポーネントのサフィックスは .contextDefinition であり、contextDefinitions フォルダーに保存されます。

バージョン

ContextDefinition コンポーネントは、API バージョン 59.0 以降で利用できます。

特別なアクセスルール

ContextDefinition メタデータ型にアクセスするには、コンテキストサービスを有効化します。

項目

項目名 説明
contextDefinitionVersions
項目の型
ContextDefinitionVersion[]
説明
コンテキスト定義のバージョン。
contextTtl
項目の型
int
説明

このコンテキスト定義によって作成されたランタイムコンテキストインスタンスで読み込まれたデータをキャッシュに保存する期間。

デフォルト値は 10 分です。
description
項目の型
string
説明
コンテキスト定義の説明。
isProtected
項目の型
boolean
説明
メタデータ型の動作には影響を与えていない自動生成された値。
masterLabel
項目の型
string
説明

必須。

コンテキスト定義のわかりやすい名前。コンテキスト定義の作成時に定義されます。

title
項目の型
string
説明

必須。

コンテキスト定義の名前。

ContextDefinitionVersion

コンテキスト定義バージョンに関する詳細を表します。一度に有効にできるバージョンは 1 つのみです。

項目名 説明
contextMappings
項目の型
ContextMapping[]
説明
関連オブジェクトへの属性とノードの対応付け。
contextNodes
項目の型
ContextNode[]
説明
コンテキスト内のノードの構造の詳細。
endDate
項目の型
string
説明
コンテキスト定義のバージョンが無効になった日時。
isActive
項目の型
boolean
説明
コンテキスト定義バージョンが有効か (true)、否か (false) を示します。
デフォルト値は「false」です。
startDate
項目の型
string
説明

必須。

コンテキスト定義のバージョンがアクティブになった日時。
versionNumber
項目の型
int
説明

必須。

コンテキスト定義のバージョン番号。

ContextMapping

属性とノードの関連オブジェクトへの対応付けを表します。

項目名 説明
contextNodeMappings
項目の型
ContextNodeMapping[]
説明
コンテキストのノードと入力スキーマの値の対応付け。
default
項目の型
boolean
説明
コンテキスト定義バージョンへの対応付けがデフォルトか (true)、否か (false) を示します。
デフォルト値は「false」です。
description
項目の型
string
説明
コンテキストの対応付けの説明。
title
項目の型
string
説明

必須。

このコンテキストの対応付けの名前。

ContextNodeMapping

コンテキストのノードと入力スキーマの値とのリレーションを表します。

項目名 説明
contextAttributeMappings
項目の型
ContextAttributeMapping[]
説明
コンテキストに定義された属性と関連オブジェクトの値の対応付け。
contextNode
項目の型
string
説明
コンテキストノードの対応付けに関連付けられたコンテキストノードレコード。
object
項目の型
string
説明
対応付けに使用されるオブジェクトの名前。

ContextAttributeMapping

コンテキストに定義された属性と関連オブジェクトの値とのリレーションを表します。

項目名 説明
contextAttrHydrationDetails
項目の型
ContextAttrHydrationDetail[]
説明
選択された属性のデータを入力スキーマから取得する SOQL (データベース) クエリの詳細。
contextAttribute
項目の型
string
説明
コンテキスト属性の対応付けに関連付けられたコンテキスト属性レコード。
contextInputAttributeName
項目の型
string
説明

必須。

入力属性の名前。

ContextAttrHydrationDetail

選択された属性のデータを入力スキーマから取得する SOQL (データベース) クエリを示します。

項目名 説明
contextAttrHydrationDetails
項目の型
ContextAttrHydrationDetail[]
説明
特定のクエリ属性のデータを取得するクエリの詳細。
objectName
項目の型
string
説明

必須。

属性ハイドレーション詳細に使用されるオブジェクトの名前。
queryAttribute
項目の型
string
説明

必須。

ハイドレーションの取得元の SOQL クエリ。

ContextNode

コンテキスト内のノードの構造の詳細を表します。各ノードには、関連する別のノードと、オブジェクトを表す属性を指定できます。また、ノードの階層を定義することもできます。

項目名 説明
contextAttributes
項目の型
ContextAttribute[]
説明
コンテキストノードを表現するために使用する属性の詳細。
contextTags
項目の型
ContextTag[]
説明
ノードの属性の一意の識別子。
title
項目の型
string
説明

必須。

コンテキストノードの対応付けの名前。
transposable
項目の型
boolean
説明
コンテキストノードレコードのデータを項目名に変換できるか (true)、否か (false) を示します。
デフォルト値は「false」です。

ContextAttribute

コンテキストノードを表現するために使用する属性の詳細を表します。各ノードには関連する属性を 1 つ以上定義できます。

項目名 説明
contextTags
項目の型
ContextTag[]
説明
属性またはノードの短縮名。
dataType
項目の型
ContextAttributeDataType (string 型の列挙)
説明

必須。

コンテキスト属性に保存されるデータの型。

有効な値は次のとおりです。

  • boolean
  • currency
  • date
  • datetime
  • number
  • percent
  • picklist
  • reference
  • string
domainSet
項目の型
string
説明
定義内のノード間の親子関係を示すノード参照のリスト。
fieldType
項目の型
ContextAttributeFieldType (string 型の列挙)
説明

必須。

定義内のノード間の親子関係を表すノード参照のリスト。

有効な値は次のとおりです。

  • input
  • inputoutput
  • output
key
項目の型
boolean
説明
属性がノードのキー属性であるか (true)、否か (false) を示します。
デフォルト値は「false」です。
title
項目の型
string
説明

必須。

コンテキスト属性の名前。
value
項目の型
boolean
説明
属性がノード内で値として特定されるか (true)、否か (false) を示します。
デフォルト値は「false」です。

ContextTag

完全修飾のタグ構造名に代わる属性またはノードの一意な識別子を表します。

項目名 説明
title
項目の型
string
説明

必須。

コンテキストタグの名前。

宣言的なメタデータの定義のサンプル

ContextDefinition コンポーネントの例を次に示します。

1<?xml version="1.0" encoding="UTF-8"?>
2<ContextDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
3    <fullName>SampleContextDefinition</fullName>
4    <contextDefinitionVersions>
5        <contextMappings>
6            <contextNodeMappings>
7                <contextAttributeMappings>
8                    <contextAttrHydrationDetails>
9                        <objectName>CustomAccount__c</objectName>
10                        <queryAttribute>Name</queryAttribute>
11                    </contextAttrHydrationDetails>
12                    <contextAttribute>AccountName</contextAttribute>
13                    <contextInputAttributeName>AccountName</contextInputAttributeName>
14                </contextAttributeMappings>
15                <contextAttributeMappings>
16                    <contextAttrHydrationDetails>
17                        <objectName>CustomAccount__c</objectName>
18                        <queryAttribute>CustomAccountName__c</queryAttribute>
19                    </contextAttrHydrationDetails>
20                    <contextAttribute>CustomAccountName</contextAttribute>
21                    <contextInputAttributeName>CustomAccountName</contextInputAttributeName>
22                </contextAttributeMappings>
23                <contextNode>SampleContextNode</contextNode>
24                <object>CustomAccount__c</object>
25            </contextNodeMappings>
26            <default>true</default>
27            <title>CustomAccountMapping</title>
28        </contextMappings>
29        <contextMappings>
30            <contextNodeMappings>
31                <contextAttributeMappings>
32                    <contextAttrHydrationDetails>
33                        <objectName>Account</objectName>
34                        <queryAttribute>Name</queryAttribute>
35                    </contextAttrHydrationDetails>
36                    <contextAttribute>AccountName</contextAttribute>
37                    <contextInputAttributeName>AccountName</contextInputAttributeName>
38                </contextAttributeMappings>
39                <contextAttributeMappings>
40                    <contextAttrHydrationDetails>
41                        <objectName>Account</objectName>
42                        <queryAttribute>CustomAccountName__c</queryAttribute>
43                    </contextAttrHydrationDetails>
44                    <contextAttribute>CustomAccountName</contextAttribute>
45                    <contextInputAttributeName>CustomAccountName</contextInputAttributeName>
46                </contextAttributeMappings>
47                <contextNode>SampleContextNode</contextNode>
48                <object>Account</object>
49            </contextNodeMappings>
50            <description>Account Mapping</description>
51            <default>false</default>
52            <title>AccountMapping</title>
53        </contextMappings>
54        <contextNodes>
55            <contextAttributes>
56                <contextTags>
57                    <title>AccountName</title>
58                </contextTags>
59                <dataType>string</dataType>
60                <fieldType>inputoutput</fieldType>
61                <key>false</key>
62                <title>AccountName</title>
63                <value>false</value>
64            </contextAttributes>
65            <contextAttributes>
66                <dataType>string</dataType>
67                <fieldType>inputoutput</fieldType>
68                <key>false</key>
69                <title>CustomAccountName</title>
70                <value>false</value>
71            </contextAttributes>
72            <contextTags>
73                <title>SampleContextTag</title>
74            </contextTags>
75            <title>SampleContextNode</title>
76            <transposable>false</transposable>
77        </contextNodes>
78        <endDate>2097-05-10 00:00:00</endDate>
79        <startDate>2023-05-10 00:00:00</startDate>
80        <versionNumber>1</versionNumber>
81        <isActive>true</isActive>
82    </contextDefinitionVersions>
83    <description>Sample Description</description>
84    <contextTtl>10</contextTtl>
85    <isProtected>false</isProtected>
86    <masterLabel>Sample Label</masterLabel>
87    <title>Sample Title</title>
88</ContextDefinition>

前の定義を参照する package.xml の例を次に示します。

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>59.0</version>
15</Package>

マニフェストファイル内のワイルドカードのサポート

このメタデータ型では、package.xml マニフェストファイル内のワイルドカード文字 * (アスタリスク) がサポートされます。マニフェストファイルの使用についての詳細は、「zip ファイルを使用したメタデータのリリースと取得」を参照してください。