Skip to content

QRY_Builder.DataCategoryBuilder

Class

apex
global inherited sharing class QRY_Builder.DataCategoryBuilder

Fluent builder for WITH DATA CATEGORY filters.

Since: 1.0

Example:

apex
List<SObject> articles = QRY_Builder.selectFrom(KnowledgeArticleVersion.SObjectType)
    .fields(new List<String>{'Id', 'Title'})
    .condition('PublishStatus').equals('Online')
    .withDataCategory('Geography__c').at('USA__c')
    .withDataCategory('Product__c').below('Electronics__c')
    .toList();

Methods

MethodDescription
global QRY_Builder.Builder above(List<String> categoryNames)Filters to categories above any of the specified categories in the hierarchy.
global QRY_Builder.Builder above(String categoryName)Filters to categories above the specified category in the hierarchy.
global QRY_Builder.Builder aboveOrBelow(List<String> categoryNames)Filters to categories above or below any of the specified categories in the hierarchy.
global QRY_Builder.Builder aboveOrBelow(String categoryName)Filters to categories above or below the specified category in the hierarchy.
global QRY_Builder.Builder at(List<String> categoryNames)Filters to any of the specified categories.
global QRY_Builder.Builder at(String categoryName)Filters to the exact specified category.
global QRY_Builder.Builder below(List<String> categoryNames)Filters to categories below any of the specified categories in the hierarchy.
global QRY_Builder.Builder below(String categoryName)Filters to categories below the specified category in the hierarchy.

Method Details

above

apex
global QRY_Builder.Builder above(List<String> categoryNames)

Filters to categories above any of the specified categories in the hierarchy.

Parameters:

  • categoryNames (List) - The category API names

Returns: QRY_Builder.Builder - Builder for chaining

Throws:

Since: 1.0

Example:

apex
.withDataCategory('Geography__c').above(new List<String>{'USA__c', 'Canada__c'})

above

apex
global QRY_Builder.Builder above(String categoryName)

Filters to categories above the specified category in the hierarchy.

Parameters:

  • categoryName (String) - The category API name

Returns: QRY_Builder.Builder - Builder for chaining

Throws:

Since: 1.0

Example:

apex
.withDataCategory('Geography__c').above('USA__c')

aboveOrBelow

apex
global QRY_Builder.Builder aboveOrBelow(List<String> categoryNames)

Filters to categories above or below any of the specified categories in the hierarchy.

Parameters:

  • categoryNames (List) - The category API names

Returns: QRY_Builder.Builder - Builder for chaining

Throws:

Since: 1.0

Example:

apex
.withDataCategory('Audience__c').aboveOrBelow(new List<String>{'External', 'Internal'})

aboveOrBelow

apex
global QRY_Builder.Builder aboveOrBelow(String categoryName)

Filters to categories above or below the specified category in the hierarchy.

Parameters:

  • categoryName (String) - The category API name

Returns: QRY_Builder.Builder - Builder for chaining

Throws:

Since: 1.0

Example:

apex
.withDataCategory('Audience__c').aboveOrBelow('External')

at

apex
global QRY_Builder.Builder at(List<String> categoryNames)

Filters to any of the specified categories.

Parameters:

  • categoryNames (List) - The category API names

Returns: QRY_Builder.Builder - Builder for chaining

Throws:

Since: 1.0

Example:

apex
.withDataCategory('Geography__c').at(new List<String>{'USA__c', 'Canada__c'})

at

apex
global QRY_Builder.Builder at(String categoryName)

Filters to the exact specified category.

Parameters:

  • categoryName (String) - The category API name

Returns: QRY_Builder.Builder - Builder for chaining

Throws:

Since: 1.0

Example:

apex
.withDataCategory('Geography__c').at('USA__c')

below

apex
global QRY_Builder.Builder below(List<String> categoryNames)

Filters to categories below any of the specified categories in the hierarchy.

Parameters:

  • categoryNames (List) - The category API names

Returns: QRY_Builder.Builder - Builder for chaining

Throws:

Since: 1.0

Example:

apex
.withDataCategory('Product__c').below(new List<String>{'Electronics__c', 'Clothing__c'})

below

apex
global QRY_Builder.Builder below(String categoryName)

Filters to categories below the specified category in the hierarchy.

Parameters:

  • categoryName (String) - The category API name

Returns: QRY_Builder.Builder - Builder for chaining

Throws:

Since: 1.0

Example:

apex
.withDataCategory('Product__c').below('Electronics__c')