Skip to main content
sivakrishnam0002
June 30, 2023
Question

Filtering by multiple conditions

  • June 30, 2023
  • 7 replies
  • 0 views

ID

refId

Title

Status

1

10

Test1

Approved

2

10

Test2

In-Review

3

10

Test3

Approved

4

10

Test4

Approved

How to write query filter to fetch refId=10 when status all rows should be Approved

    7 replies

    June 30, 2023

    I don't think this is a challenge for a Certified Associate Dev. Just write two query filters with "AND" operator in queryLogicalExpression(). One for refId=10 and other for Status="Approved".

    sivakrishnam0002
    June 30, 2023

    is it possible to write single filter without using refId=10

    June 30, 2023

    What? No. Can you please explain the requirements more clearly?

    mathieud0001
    Brainy
    June 30, 2023

    Personally, the easiest way to do this if you are using Records would be to do a aggregate related record (custom record field) on the parent record where you count all the records <> approved. You then make a query that filters on the ref ids that have 0 "unapproved" records.