Skip to main content

I would like the equivalent of 

 

select * from APIRequests

where (processed == false or processed is null)

and (siteid = current.siteid or current.siteid is null)

 

below is as close as I could get with BQL, but still missing one or statement:

 var cmd = new PXSelect<APIRequests, Where<

 APIRequests.siteID, Equal<Current<APIRequestsFilter.siteID>>,

 And

 <Where<APIRequests.processed, Equal<False>, Or<APIRequests.processed, IsNull>>>

 >, OrderBy<Asc<APIRequests.date>>>(this);

 

Hi @jkelly80 

Can you try like below?  Please verify and let me know if face any issues.

               var cmd = new PXSelect<APIRequests,
                                              Where2<Where<APIRequests.processed, Equal<False>, Or<APIRequests.processed, Equal<Null>>>,
                                              And<Where<APIRequests.siteID, Equal<Current<APIRequests.siteID>>, Or<APIRequests.siteID, Equal<Null>>>>>,
                                              OrderBy<Asc<APIRequests.date>>>(this);


hi @jkelly80 

In continuation to @jinin  code we can also define Is null with out Equal 

var cmd = new PXSelect<APIRequests,
              Where2<Where<APIRequests.siteID, Equal<Current<APIRequestsFilter.siteID>>,
                        Or<APIRequests.siteID, IsNull>>,
                  Or<Where<APIRequests.(processed, Equal<Current<APIRequestsFilter.(processed >>,
                        Or<APIRequests.(processed, IsNull >>>>>(this);


Reply