Dashboard BAQ Select Multiple Options

I made a dashboard with a BAQ, and I am trying to make the dashboard select multiple parameters for the baq. I have searched through multiple threads about this, but I could not find something that works for this.

What I thought would work is doing an IN statement for the parameter.


Unfortunately, that does not seem to work if I select multiple departments, or no departments at all. Selecting one department seems to work though.



The BAQ itself works perfectly fine when there are no items in the list, or when there are two items in the list.

Is there a way to allow the dashboard to select multiple items like in the BAQ?

2 Likes

If it matters, I was following this guide BAQ Parameters in Application Studio - Replace Slide-Out with on-page Search Filters - Kinetic ERP - Epicor User Help Forum and the taming dashboard dragons guide that it links to. Should I just try to make the dashboard via the client dashboard menu for now? I would really prefer for there to be no slide outs, which is why I followed the above guide.

Yeah if you want no slide out, you have to not use parameters. I believe you want to create a dashboard from your BAQ. But first, make a copy of your BAQ and remove the parameters from your the copy. Build your dashboard based on that copy. Do all the filtering using Application studio.

This isn’t exactly what you need, but it might help:
Filter Kinetic BAQ Combo Box - Kinetic ERP - Epicor User Help Forum

3 Likes

Can you share the param value expression? I suspect it’s passing a tilde delimited list rather than one expected by t-sql IN clause. So your BAQ works for in(‘dept1’) but not for in(‘dept1~dept2’). If that’s the case, you can Convert to sql like so:

3 Likes

I already changed the baq to just have 4 separate parameters, since that was the easiest. But I do know for sure that the application was selecting multiple values with a tilde in between them, that is what the text boxes showed. I will make a copy of the menu and BAQ and get back to you with what the results are. Thanks!

So I tried this, but it looks like when I convert the search filter to SQL, nothing shows up. This happens with a single selection or multiple selections on an erp-selection-list.


The BAQ parameter is the following:


I had it as an IN with a list because I figured that would work for selecting multiple objects. I figured since you mentioned parameters in your post, that parameters would be needed for this. I tried it without parameters, using the provider model in the grid, and that did not work either.

The BAQ itself works fine when I run it with the following parameters.


image

This is what I put in for the function in the event:

And this is the BAQ-Get widget:

I am guessing the issue is that the BAQ is passing the ’ and not liking it. If not, what am I doing wrong here?

Looks good. Can you enable debug and inspect the value in SearchFilters.DepSQL?

Edit: oh I see that now

that correct. Let’s look at the ExecuteBaq request Parameter object.

1 Like

I am a bit confused, what are you asking me to look at? Do you mean the baq action in the search button event? If so, here it is

And the parameter for the list.

If you meant something else, then let me know.

To see what it really doing we’d have to look at the BaqExecute request in the browser webtools (F12). But it’s coming back to me now, params are different.

What I believe will work is making the BAQ param optional and passing the IN() using BAQ Where like this:

1 Like

Here is what I put in for my BAQ execute options in the baq action.


I confirmed that the parameter in the BAQ allows empty values.

I just ran the application again with the browser tools (I forgot you had to turn on debug mode, that was where I was confused) and it looks like the issue is that the expression must have a join clause.

Well done. Try it without the question mark in the Where expression.

1 Like

Did that, but now it is saying that it cannot read properties of undefined.

okay but does it work with one or two params chosen?

Nope, the screenshot of the console is what I get no matter what I click. It could be all, one, or none and I get the same thing.

okay so the erp-baq action isn’t evaluating expressions like it should. Expected behavior for question marks is like so: App Studio - Clarification of question mark syntax in expressions/values - #2 by BKen

so your original expression IN(?{dv.field}) is correct but eval keeping the question mark IN(?'FLAME','LAM') is a bug in the widget.

I forget, does the erp-baq action have a Where List property? If so, where list can possibly work when where does not.

The action widget does not seem to have a where list property. Just the parameters and execute option. However, the panel grid does have a where list in the grid model > provider model > baq options. I was not using that.

I tried to do IN with the where list in the grid model. The parameters were removed from the original BAQ, and I added the following to the where list (along with the date options). I tried one ? as well.

With this, selecting multiple items on the list gives me everything that the original BAQ would get, including things outside the date range. Selecting nothing will get me all resource groups within the date range. Selecting one will show nothing in the grid.

Dev tools showing multiple selections:

No selections:

One selection:

Closer. Add parentheses around Where List value expression. And if that doesn’t work, try with both single and double question mark.