# Create SubQuery Criteria Filter in app studio

**URL:** <https://www.epiusers.help/t/create-subquery-criteria-filter-in-app-studio/137117>\
**Category:** Kinetic ERP\
**Tags:** dashboard, baq, customization, application-studio, epicor\
**Created:** [August 21, 2026, 4:58pm UTC](https://www.epiusers.help/t/create-subquery-criteria-filter-in-app-studio/137117 "2026-08-21T16:58:12Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![KP\_Interface](https://www.epiusers.help/user_avatar/www.epiusers.help/kp_interface/32/62305_2.png) [@KP\_Interface](https://www.epiusers.help/u/KP_Interface)\
**Post date:** [August 26, 2026, 5:02pm UTC](https://www.epiusers.help/t/create-subquery-criteria-filter-in-app-studio/137117/21 "2026-08-26T17:02:12Z")

</div>

It is finally complete, and thanks! SO, I am gonna sit on my soapbox here and give everyone some context for why I did this really quick. Basically, I wanted to filter a query after the results are printed. I was joining jobs and orders where I wanted to see all the orders and jobs regardless of if they have an attached order or not, which worked but I then wanted my dashboard to be able to filter out the jobs that dont have orders or orders that dont have jobs when needed. That does not work when I have a join which returns all rows from both tables because then You will just get every row without the order information instead of filtering out jobs without orders or vice versa.

So the solution for me was using Subquery Criteria! These allowed me to filter the data AFTER the query itself ran, meaning I can remove the values I don’t want without having to still see empty rows that have data in one table but not the other. It almost acts as if I have the two tables not joined on the query and I can filter them separately, then get data from both when needed, or get data from both when joined regularly. Seems like the sky is really the limit for this sort of idea where you can basically filter any query without altering the query itself. Anyways here is what I did:

Join between subquery with job info and order rel info attached (subquery 3 is just order hed and customer info so it doesn’t technically have to be a subquery but it just seemed cleaner that way)

 ![image](https://www.epiusers.help/uploads/default/original/3X/a/6/a68ed6924e25b93f558cf5d52a3174cb8b71cfc0.png)

So after that was working here are the subquery criteria I made:

 ![image](https://www.epiusers.help/uploads/default/original/3X/c/2/c24ca4aea272756ff217bc4523f421c01bba20ad.png)

Each of these subquery criteria is either set to be greater than 0 or equal to a boolean value. These allow me to filter in order: Filter open or closed orders, get all orders regardless of if it has a job or not, get all jobs regardless if it has an order or not, filter open or closed jobs, filter out rows without orders, and finally filter out rows without jobs. For the last one I used a calculated field that uses nonull since the results of the jobprod\_jobNum field has some null values. Seemed easier than dealing with nulls, but I am sure there is a way around that without using calculated fields but I have a job to do and this works so moving on.

Next I set the query parameters as the lads suggested, thanks again:

 ![image](https://www.epiusers.help/uploads/default/original/3X/4/e/4e2ffb362c5bcbc7569e6279fe76aba7c94ab5d4.png)

setting them all to char just seemed to work, but I think there is a way to use the correct data type just not sure how.

On the app studio side I ended up using callcontextBPMData.Character02 and checkbox01 for the 0 value and true false values respectively. character01 is being used by my dropdown currently.

I then created a data event that fires whenever callcontextBPMData.Character01 is updated (my dropdown) and ran this event to then decide which filter I am going to use:

 ![image](https://www.epiusers.help/uploads/default/original/3X/e/0/e014a116e02382731ef3080606f96ecf7e40d17c.png)

Each condition is checking for a different value for the dropdown (If anyone knows how to use case instead of condition, please let me know I can’t get it to work for the life of me lol) this works just fine, probably very slow programmatically but I don’t have too much else going on so it should be ok.

On True I update the checkbox and character 02 fields"

 ![image](https://www.epiusers.help/uploads/default/original/3X/8/1/81e3ffdf693ad575f1daccfb1b373f957a920661.png)

 ![image](https://www.epiusers.help/uploads/default/original/3X/8/a/8a3f1cb61300909d1b6e3ee2cc7a67de37cee743.png)

only reason I call it each time instead of setting it at the beginning is because if I want the checkbox values to be different depending on which condition is true. I know I can find a way to set some of the rows before the condition check fires, but this works and I am not doing it again so moving on

I then create a BAQ event that grabs my BAQ, and go into the parameters as suggested and enter the rows I just updated prior:

 ![image](https://www.epiusers.help/uploads/default/original/3X/2/3/238d4f5554254754e38eef8ffe29150c2e7245e8.png)

(Note) I do set each parameter to be ignored if empty so I can have multiple, but if you want to force an entry all the time you would set that on the BAQ query parameters section.

I ended up deleting transview since passing the values to the custom fields I made there seemed to not work, I was probably just doing something wrong or app studio was bugging out on me as per usual ( I recreated this 8 times and I am not trying to find out if transview works by remaking it a 9th time)

Then after all that it just works! Final Product:

 ![image](https://www.epiusers.help/uploads/default/original/3X/5/0/507171223094ed67a66ea523b7cad25e189042bb.png)

 ![image](https://www.epiusers.help/uploads/default/original/3X/d/d/dda079681ef591aaed65b851d971a6531b277d7d.png)

 ![image](https://www.epiusers.help/uploads/default/original/3X/5/d/5dc980b791bc75898446d2b300d1daa3f274a382.png)

Production will now be very happy that they can filter open and closed stock jobs, and find which orders dont have jobs processed yet by the CSRs. Hope this helps with other peoples projects!

---

<div class="post-metadata">

**Author:** ![knash](https://www.epiusers.help/user_avatar/www.epiusers.help/knash/32/74179_2.png) [@knash](https://www.epiusers.help/u/knash)\
**Post date:** [August 26, 2026, 5:23pm UTC](https://www.epiusers.help/t/create-subquery-criteria-filter-in-app-studio/137117/22 "2026-08-26T17:23:18Z")

</div>

Love this!!! Nice Writeup!!!

---

<div class="post-metadata">

**Author:** ![utaylor](https://www.epiusers.help/user_avatar/www.epiusers.help/utaylor/32/64664_2.png) [@utaylor](https://www.epiusers.help/u/utaylor)\
**Post date:** [August 26, 2026, 6:13pm UTC](https://www.epiusers.help/t/create-subquery-criteria-filter-in-app-studio/137117/23 "2026-08-26T18:13:40Z")

</div>

Thanks for following up with your solution!

Glad you were able to get something working for you. Would be great to catch up and talk shop as well.

[Previous page](https://www.epiusers.help/t/create-subquery-criteria-filter-in-app-studio/137117.md?page=1)
