Filter a value and null values

Code snippet below shows a filter for field test whose value is reviewing.

a!queryFilter(
field: recordType! a.fields.test
operator: "=",
value: "Reviewing"
)

How can I filter field test whose values are "reviewing" or null?  I should be able to get rows 1 and 2

test
1 reviewing
2
3 resolved

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Few points to note. 

    - Must use a!queryRecordType(). Cannot use a!queryEntity() with recordType constant as the entity.

    The batch size when querying record data must be between 0 and 5,000.

    a!queryRecordType(
      recordType: cons!XXX_RECORD_EMP,
      filters: a!queryLogicalExpression(
        operator: "OR",
        filters: {
          a!queryFilter(
            field: 'recordType!{xx-xx-xx-xx-xx}Employee.fields.{xx-xx}department',
            operator: "=",
            value: "IT"
          ),
          a!queryFilter(
            field: 'recordType!{xx-xx-xx-xx-xx}Employee.fields.{xx-xx}department',
            operator: "is null"
          )
        },
        ignoreFiltersWithEmptyValues: true
      ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: 50
        )
    )

Reply
  • 0
    Certified Lead Developer

    Few points to note. 

    - Must use a!queryRecordType(). Cannot use a!queryEntity() with recordType constant as the entity.

    The batch size when querying record data must be between 0 and 5,000.

    a!queryRecordType(
      recordType: cons!XXX_RECORD_EMP,
      filters: a!queryLogicalExpression(
        operator: "OR",
        filters: {
          a!queryFilter(
            field: 'recordType!{xx-xx-xx-xx-xx}Employee.fields.{xx-xx}department',
            operator: "=",
            value: "IT"
          ),
          a!queryFilter(
            field: 'recordType!{xx-xx-xx-xx-xx}Employee.fields.{xx-xx}department',
            operator: "is null"
          )
        },
        ignoreFiltersWithEmptyValues: true
      ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: 50
        )
    )

Children
No Data