ID
refId
Title
Status
1
10
Test1
Approved
2
Test2
In-Review
3
Test3
4
Test4
How to write query filter to fetch refId=10 when status all rows should be Approved
Discussion posts and replies are publicly visible
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".
is it possible to write single filter without using refId=10
What? No. Can you please explain the requirements more clearly?
How should that work. You have TWO conditions! Or is that a misunderstanding?
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.
sivakrishnam0002 said:fetch refId=10 when status all rows should be Approved
I'm trying to (re) parse this phrase and I can't quite decide what we should land at. Typically we'd say "fetch all rows with refId = 10 AND status of 'Approved'", but that's different than this (depending on how liberal we are with phrasing / language barrier flexibility, and seemingly confirmed by OP's subsequent reply above). Definitely seems to require some clarification here though.
Pretty sure he/she wants to find all refIds where all the statuses are approved. i.e. if one of the statuses is different than approved, that refId is not returned.