Skip to main content

FiltersGroup

add

Allows to add multiple conditions. Add a QB.Filter or QB.FiltersGroup.

Signature

FiltersGroup add(FilterClause condition)

Example

SOQL.of(Account.sObjectType)
.whereAre(SOQL.FiltersGroup
.add(QB.Filter.with(Account.Name).equal('My Account'))
.add(QB.Filter.with(Account.NumberOfEmployees).greaterThanOrEqual(10))
)
// build conditions on fly
FiltersGroup group = SOQL.FiltersGroup
.add(QB.Filter.with(Account.Name).equal('My Account'))
.add(QB.Filter.with(Account.NumberOfEmployees).greaterThanOrEqual(10))
.conditionLogic('1 OR 2');

SOQL.of(Account.sObjectType)
.whereAre(SOQL.FiltersGroup
.add(QB.Filter.with(Account.Industry).equal('IT'))
.add(group)
)

conditionLogic

Set conditions order for SOQL query. When not specify all conditions will be with AND.

Signature

FiltersGroup conditionLogic(String order)

Example

SOQL.of(Account.sObjectType)
.whereAre(SOQL.FiltersGroup
.add(QB.Filter.with(Account.Name).equal('My Account'))
.add(QB.Filter.with(Account.NumberOfEmployees).greaterThanOrEqual(10))
.add(QB.Filter.with(Account.Industry).equal('IT'))
.conditionLogic('(1 AND 2) OR (1 AND 3)')
)