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

describeDataCategoryGroups()

要求で指定されたオブジェクトで使用できるカテゴリグループを取得します。

構文

1DescribeDataCategoryGroupResult[] = connection.describeDataCategoryGroups()(string[] sObjectTypes);

使用方法

要求で指定されたオブジェクトで使用できるカテゴリグループを取得するには、このコールを使用します。このコールを describeDataCategoryGroupStructures() コールと一緒に使用すると、特定のオブジェクトで使用できるすべてのカテゴリを取得できます。データカテゴリについての詳細は、Salesforce オンラインヘルプの「データカテゴリとは?」を参照してください。

サンプルコード —Java

このサンプルでは、次に関連付けられているデータカテゴリグループを取得する方法を示します。
  • Salesforce ナレッジ記事
  • アンサー機能の質問
このサンプルは、カテゴリグループの名前、表示ラベル、および説明と、関連付けられた sobject (記事または質問) の名前を返します。また、データカテゴリグループ内のデータカテゴリ数も返します。
1swfobject.registerObject("clippy.codeblock-1", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17public void describeDataCategoryGroupsSample() {
18    try {
19        // Make the describe call for data category groups
20        DescribeDataCategoryGroupResult[] results =
21            connection.describeDataCategoryGroups(new String[] {
22                "KnowledgeArticleVersion", "Question"});
23        
24        // Get the properties of each data category group 
25        for (int i = 0; i < results.length; i++) {
26          System.out.println("sObject: " + 
27              results[i].getSobject());
28          System.out.println("Group name: " + 
29              results[i].getName());
30          System.out.println("Group label: " + 
31              results[i].getLabel());
32          System.out.println("Group description: " +
33              (results[i].getDescription()==null? "" : 
34                  results[i].getDescription()));
35          System.out.println("Number of categories: " + 
36              results[i].getCategoryCount());              
37        }
38      } catch (ConnectionException ce) {
39        ce.printStackTrace();
40    }
41}

サンプルコード —C#

このサンプルでは、次に関連付けられているデータカテゴリグループを取得する方法を示します。
  • Salesforce ナレッジ記事
  • アンサー機能の質問
このサンプルは、カテゴリグループの名前、表示ラベル、および説明と、関連付けられた sobject (記事または質問) の名前を返します。また、データカテゴリグループ内のデータカテゴリ数も返します。
1swfobject.registerObject("clippy.codeblock-2", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17public void describeDataCategoryGroups() {
18    try {
19        // Make the describe call for data category groups
20        DescribeDataCategoryGroupResult[] results =
21            binding.describeDataCategoryGroups(new String[] {
22                "KnowledgeArticleVersion", "Question"});
23            
24        // Get the properties of each data category group 
25        for (int i = 0; i < results.Length; i++) {
26            Console.WriteLine("sObject: " + 
27                results[i].sobject);
28            Console.WriteLine("Group name: " + 
29                results[i].name);
30            Console.WriteLine("Group label: " + 
31                results[i].label);
32            Console.WriteLine("Group description: " +
33                (results[i].description==null? "" : 
34                    results[i].description));
35            Console.WriteLine("Number of categories: " + 
36                results[i].categoryCount);              
37        }
38        } catch (SoapException e) {
39            Console.WriteLine("An unexpected error has occurred: " +
40                    e.Message + "\n" + e.StackTrace);
41    }
42}

引数

名前 説明
sObjectTypes string[] 次のいずれかの値を指定できます。
  • KnowledgeArticleVersion: 記事タイプに関連するカテゴリグループを取得します。
  • Question: 質問タイプに関連するカテゴリグループを取得します。

記事および質問についての詳細は、Salesforce オンラインヘルプの「記事と翻訳の管理」および「アンサーの概要」を参照してください。