Kinetic BAQ widget in Application Studio

Good morning,

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.

Top Level BAQ

Top Level Display fields

Application Studio BAQ Widget


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.

1 Like

Just tossing out examples of what I’ve used.

Have you tried adding the “??”

image

Here’s another example of one of mine, which works, just to give an example of a “AND” where clause:

Part_PartNum = '??{Part.PartNum}' AND PORel_OpenRelease = 'False'

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.

Thanks David

Do you know what the ?? does?

I could be wrong (often am)…

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.

1 Like

The question mark notation actually (frustratingly) does not work with the BAQ widget’s Execute Options. RIP.

3 Likes

That’s, indeed, how it should be.

ShipTo_CustNum = {Customer.CustNum}

I would hook your widget up to a button and monitor Dev Tools to see what it’s passing in the payload.

(Strings will be wrapped in single quotes)

Thank you, I also thought that and had went back and forth on trying with and without.

Thank you! I thought I was going crazy.

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.

1 Like

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.