Sample Code:
List < DescribeDataCategoryGroupResult > describeCategoryResult = new List < DescribeDataCategoryGroupResult >();
List < String > objType = new List < String >() ;
objType.add ( 'KnowledgeArticleVersion' ) ;
//Describe Call
describeCategoryResult = Schema.describeDataCategoryGroups( objType ) ;
system.debug( 'All Categories '+ describeCategoryResult ) ;
//Using the results and retrieving the information
for ( DescribeDataCategoryGroupResult singleResult : describeCategoryResult ) {
system.debug(
singleResult.getName() + ' - ' +
singleResult.getLabel() + ' - ' +
singleResult.getDescription() + ' - ' +
singleResult.getSobject());
}
List < String > objType = new List < String >() ;
objType.add ( 'KnowledgeArticleVersion' ) ;
//Describe Call
describeCategoryResult = Schema.describeDataCategoryGroups( objType ) ;
system.debug( 'All Categories '+ describeCategoryResult ) ;
//Using the results and retrieving the information
for ( DescribeDataCategoryGroupResult singleResult : describeCategoryResult ) {
system.debug(
singleResult.getName() + ' - ' +
singleResult.getLabel() + ' - ' +
singleResult.getDescription() + ' - ' +
singleResult.getSobject());
}