Application Studio Dynamic View Options Drop Down

I’ve created an Application Studio Dashboard listing all the parts.
It’s been requested to have a Grid View Options Drop Down to Filter by Part Class. Looking at the View Options Properties, it seems like that maybe be possible, but I can’t work out how to do it.
We want this Dynamic so it will always list all the Part Classes that are Active, and when they select a Part Class this Grid filters to just parts that belong to that Class.
I’ve looked at many topics on here and I see hints, but I’m not even sure if it’s possible or not with the View Options Properties and maybe I need to add a regular combo?

You can try looking at the help documentation titled " Adding a Combo Box to List UD Codes in Part Maintenance". I believe this will have what you are looking for and it can explain it better than I can.

I would just add a combobox into the grid’s header… then use that to filter.

Are you populating your grid via BAQ or dataview?

The grid is being populated by a BAQ, but I would like the drop down filter to list all active part classes so I thought PartClasSvc.GetList would be a good idea?

So I’m not sure how to make a combo box in the Grid Header affect as a filter for the grid data.

Add a condition to the where list.

That example is for a date, the idea can be adapted. You will need to bind your dropdown to a TransView field of your choice and reference it here. I think if you use two ?? you could have the dropdown filter be optional by making it accept nulls.

There are many ways to populate a combo box, i perfer to use a BAQ.(under advanced)

I struggled to get this to work in just a plain BAQ grid. The filter worked fine, but I couldn’t CLEAR the filter and get it to re-run the BAQ full open to show all parts again. I could clear the filter value, but the BAQ wouldn’t automatically re-run.

I, instead, switched to a dataview that is populated by a BAQ so I could then just filter the dataview client side.

You can use the dataview wizard to create a BAQ dataview… it will create the “get” event for you.

I have an event after windowOnLoad that initially fires that “Get” event to pre-populate my dataview and grid:

To set up the filter…

Add a combobox above your Grid:

Properties:

Bind it to a temp dataview.column (like TransView.PartClassFilter)… if this is a custom dashboard, you will need to create the TransView dataview yourself and initiate it.

Epicor already has a reusable combo for Part Class.

Stick with the “default” settings in your reusable combo EXCEPT… towards the bottom, add a Filters Append so you can filter out inactive part classes:

Then, go into your Grid Properties > Grid Model > Provider Model and delete your BAQ info there (if you’re attempting the datview route).

Instead, in Grid Model, just link it to your dataview.

Then all you need is an event to filter your dataview based off of your drop down.

Trigger is DataTable > OnChange > TransView > PartClassFilter

I set a condition where if TransView.PartClassFilter is empty
'{TransView.PartClassFilter}' === ''

If True:
DataView-Filter-Set where Part_ClassID <> blank (returns all rows (unless you have parts without a Part Class assigned))

If False:
DataView-Filter-Set where Part_ClassID = our TransView.PartClassFilter

Results:
Unfiltered

Dropdown works, populated with part classes:

Selection filters the dataset:

Clearing the filter, again, returns all parts. (This was the only thing I couldn’t quite get to work with a simple BAQ grid).

5 Likes

To for sure return all rows on any filter or where clause you can set the expression to:
1 = 1