I am trying to send data to a BAQ with a subquery but I can’t seem to filter the BAQ at the top level by the values I have. I have done this successfully with a plain BAQ (no subqueries) by setting erp-baq > BAQ Execute Options > Where JobHead_JobNum = ‘{ReqDetail.JobNum}’
The BAQ this is referring to joins JobHead and Project so the JobHead_JobNum seems to correspond to the JobHead table and JobNum field.
My current BAQ I am trying to make work does the math in the subquery and at the top level, groups by the CustNum and finds the maximum value. I want that maximum value. I have a button used to test this BAQ query and displays the value in the dataview that is supposed to be populated but it always returns undefined.
I have tried removing the quotes in the last screenshot but no change. I have also tried addind Calculate_ShipToInc.ShipTo_CustNum in the WHERE clause but I didn’t see any change.
I will test this. I was able to reduce this to a 1 level BAQ and it is working. I needed to get this working so I removed some complexities to get it to the form I am comfortable working with.
And actually, I think one (?) is probably more suitable.
One question mark (?) will return results to the grid when it matches that value. So, ShipTo_CustNum = your Customer.CustNum value.
Two question marks (??) will return results to the grid even if a value isn’t provided (null). So, in that use case, you would get results in your grid even if Customer.CustNum is null.
So, one ? is probably the preferred way.
The Where Clause is nice when you want to chain things together with AND / OR statements, but you can also use the Where List in the BAQ options if that is more straight forward.
Any way to get the BAQ to return results when a value being passed is null?
I’m using TransView fields to successfully return a range when one is entered, but also need to return results if neither start/end is entered and/or only one is entered.
This is a pretty long thread dealing with dates (not sure if that’s what you’re dealing with or not) but perhaps you can glean some ideas from it. It was a fairly recent discussion.
One thought was to preset default bounds so you weren’t sending null values… they were more like min/max default values.
Thanks, @dcamlin. I’ll take a look at that (not using dates; querying serial numbers that are numeric).
I’m also trying instead to use the provider model BAQ options Where List to filter on my two (start/end) TransView fields, but so far I am able to return results when no values entered, but now it won’t filter based on any inputs.
Since I’m trying to replicate the SN Selection slide out, I do need to also review one of these screens to see if I can determine how it’s handled by Epicor.