Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
describeDataCategoryGroups()
Syntax
1DescribeDataCategoryGroupResult[] = connection.describeDataCategoryGroups()(string[] sObjectTypes);Usage
Use this call to describe the available category groups for the objects specified in the request. This call can be used with the describeDataCategoryGroupStructures() call to describe all the categories available for a specific object. For additional information about data categories, see “Work with Data Categories” in the Salesforce online help.
Sample Code—Java
- Salesforce Knowledge articles
- Questions from the Answers feature
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 }Sample Code—C#
- Salesforce Knowledge articles
- Questions from the Answers feature
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 }Arguments
| Name | Type | Description |
|---|---|---|
| sObjectTypes | string[] | The specified value can be:
For additional information about articles and questions, see "Work with Articles and Translations" in the Salesforce online help. |
Response
DescribeDataCategoryGroupResult
Faults
InvalidSObjectFault
UnexpectedErrorFault