Retrieves available category groups for objects specified in the request.
DescribeDataCategoryGroupResult[] = connection.describeDataCategoryGroups()(string[] sObjectTypes);
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 “What are Data Categories?” in the Salesforce online help.
public void describeDataCategoryGroups() { try { DescribeDataCategoryGroupResult[] results = connection.describeDataCategoryGroups(new String[] { "Account", "Lead" }); for (int i = 0; i < results.length; i++) { System.out.println("sObject: " + results[i].getSobject()); System.out.println("Group name: " + results[i].getName()); System.out.println("Group label: " + results[i].getLabel()); System.out.println("Group description: " + results[i].getDescription()); System.out.println("Category count: " + results[i].getCategoryCount()); } } catch (ConnectionException ce) { ce.printStackTrace(); } }
private void describeDataCategoryGroupsSample() { try { DescribeDataCategoryGroupResult[] results = binding.describeDataCategoryGroups( new string[] { "KnowledgeArticleVersion", "Question" } ); for (int x=0;x<results.Length;x++) { DescribeDataCategoryGroupResult categoryGroup = results[x] ; // Get the name of the associated SObject string sObject = categoryGroup.getSobject(); Console.WriteLine("sObject: " + sObject); // Get the name of the data category group string dataCategoryGroupName = categoryGroup.getName(); Console.WriteLine("Group name: " + dataCategoryGroupName); // Get the label of the data category group string dataCategoryGroupLabel = categoryGroup.getLabel(); Console.WriteLine("Group label: " + dataCategoryGroupLabel); // Get the description of the data category group string dataCategoryGroupDescription = categoryGroup.getDescription(); Console.WriteLine("Group description: " + dataCategoryGroupDescription); // Get the count of the data categories in the data // category group structure int dataCategoryCount = categoryGroup.getCategoryCount(); Console.WriteLine("Category count: " + dataCategoryCount); } } catch (Exception ex) { Console.WriteLine("\nFailed to get data category group descriptions."); Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } }
| Name | Type | Description |
|---|---|---|
| sObjectTypes | string[] | The specified value can be:
For additional information about articles and questions, see “Managing Articles and Translations” and “Answers Overview” in the Salesforce online help. |