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

describeDataCategoryGroups()

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

構文

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

使用方法

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

サンプルコード —Java

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

サンプルコード —C#

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

引数

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

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