QRY_Builder.DataCategoryBuilder
Class
global inherited sharing class QRY_Builder.DataCategoryBuilderFluent builder for WITH DATA CATEGORY filters.
Example
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
| Method | Description |
|---|---|
| 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. |
above
global QRY_Builder.Builder above(List<String> categoryNames)Filters to categories above any of the specified categories in the hierarchy.
Parameters
| Parameter | Type | Description |
|---|---|---|
categoryNames | List | The category API names |
Returns QRY_Builder.Builder — Builder for chaining
Throws
| Exception | Description |
|---|---|
| IllegalArgumentException | if categoryNames is null or empty |
Example
.withDataCategory('Geography__c').above(new List<String>{'USA__c', 'Canada__c'})global QRY_Builder.Builder above(String categoryName)Filters to categories above the specified category in the hierarchy.
Parameters
| Parameter | Type | Description |
|---|---|---|
categoryName | String | The category API name |
Returns QRY_Builder.Builder — Builder for chaining
Throws
| Exception | Description |
|---|---|
| IllegalArgumentException | if categoryName is blank |
Example
.withDataCategory('Geography__c').above('USA__c')aboveOrBelow
global QRY_Builder.Builder aboveOrBelow(List<String> categoryNames)Filters to categories above or below any of the specified categories in the hierarchy.
Parameters
| Parameter | Type | Description |
|---|---|---|
categoryNames | List | The category API names |
Returns QRY_Builder.Builder — Builder for chaining
Throws
| Exception | Description |
|---|---|
| IllegalArgumentException | if categoryNames is null or empty |
Example
.withDataCategory('Audience__c').aboveOrBelow(new List<String>{'External', 'Internal'})global QRY_Builder.Builder aboveOrBelow(String categoryName)Filters to categories above or below the specified category in the hierarchy.
Parameters
| Parameter | Type | Description |
|---|---|---|
categoryName | String | The category API name |
Returns QRY_Builder.Builder — Builder for chaining
Throws
| Exception | Description |
|---|---|
| IllegalArgumentException | if categoryName is blank |
Example
.withDataCategory('Audience__c').aboveOrBelow('External')at
global QRY_Builder.Builder at(List<String> categoryNames)Filters to any of the specified categories.
Parameters
| Parameter | Type | Description |
|---|---|---|
categoryNames | List | The category API names |
Returns QRY_Builder.Builder — Builder for chaining
Throws
| Exception | Description |
|---|---|
| IllegalArgumentException | if categoryNames is null or empty |
Example
.withDataCategory('Geography__c').at(new List<String>{'USA__c', 'Canada__c'})global QRY_Builder.Builder at(String categoryName)Filters to the exact specified category.
Parameters
| Parameter | Type | Description |
|---|---|---|
categoryName | String | The category API name |
Returns QRY_Builder.Builder — Builder for chaining
Throws
| Exception | Description |
|---|---|
| IllegalArgumentException | if categoryName is blank |
Example
.withDataCategory('Geography__c').at('USA__c')below
global QRY_Builder.Builder below(List<String> categoryNames)Filters to categories below any of the specified categories in the hierarchy.
Parameters
| Parameter | Type | Description |
|---|---|---|
categoryNames | List | The category API names |
Returns QRY_Builder.Builder — Builder for chaining
Throws
| Exception | Description |
|---|---|
| IllegalArgumentException | if categoryNames is null or empty |
Example
.withDataCategory('Product__c').below(new List<String>{'Electronics__c', 'Clothing__c'})global QRY_Builder.Builder below(String categoryName)Filters to categories below the specified category in the hierarchy.
Parameters
| Parameter | Type | Description |
|---|---|---|
categoryName | String | The category API name |
Returns QRY_Builder.Builder — Builder for chaining
Throws
| Exception | Description |
|---|---|
| IllegalArgumentException | if categoryName is blank |
Example
.withDataCategory('Product__c').below('Electronics__c')