App Studio filter BAQ by multiple field

Hi,

I have added a data view for a baq and created an event to load data into the data view.
If I want to use a Text Box to show a field from a BAQ i can do this perfectly fine if i have one relationship +Company relationship in the data view. (IE CustID or PartNum)

If i try to use a relationship from both CustID and PartNum then the results are blank. If I put the criteria direct on the baq it gives me 1 row and shows that data I require. Is there a way i can do this in App studio?

I have tried to use WHERE PriceLstParts_PartNum = ‘?{PriceListInquiryCriteria.PartNum}’, Customer_CustID = ?{PriceListInquiryCriteria.CustID} when the event runs to load the dataset as well as using relationships to the BAQ from the DataView page.

@hmwillett you helped me out in my last App Studio quest, is this something you could help with?

Throw some single quotes around your second filter like you did the first and see if that helps.

Unfortunately, that hasn’t worked, i get all blanks.
Just to clarify, I’m looking to populate a text box rather than a grid using these two filters.

I guess I’m not 100% clear on what you’re trying to do, but I’m going to hazard a guess and offer a solution based on that guess.

You’re loading a DataView from a BAQ that needs to be filtered by 2 dynamic fields which would hopefully yield a single row. You then want to take a column from that query to load into a textbox.

So, load the BAQ data like you normally would.
To filter it, create an event that fires off of one the the fields changing that are the filters.
Within that event, you should be able to use the dataview-filter-set widget to filter your BAQ to get your single row.

ABCTest.PartWhse_MinAbc = {ABCCode.ABCCode} AND ABCTest.PartWhse_PartNum = '10024'

1 Like

@hmwillett Yes that’s exactly what i am trying to achieve :slight_smile:
I have tried the event with the following parameters and still nothing loads into the text boxes.

Dataview - UD_CustomerPriceList

UD_CustomerPriceList.Customer_CustID = {PriceListInquiryCriteria.CustID} AND UD_CustomerPriceList.PriceLstParts_PartNum = ‘?{PriceListInquiryCriteria.PartNum}’

When running the event it just loads then eventually throws up a Server Error has Occurred.

Just to Clarify my steps.

  1. Create Data View using BAQ ID (No Relationships)
  2. Create Event (Trigger = AfterPartNumChanged) to populate the BAQ (No Filters)
  3. Create SUCCESS link to Dataview Filter Set and type the below into the Parameters > WHERE box.

UD_CustomerPriceList.Customer_CustID = {PriceListInquiryCriteria.CustID} AND UD_CustomerPriceList.PriceLstParts_PartNum = ‘?{PriceListInquiryCriteria.PartNum}’

@hmwillett I have managed to stop the Server Errors by splitting the two filters into 2 Dataview-Filter-Set tasks.
I have viewed the dev tools and it seems to be filtering as i want but i still get no returned column in my text box. (for some reason i cannot see any of the Loaded DataViews through the dev tools though)

When in the preview, with Dev Tools open and debugging enabled, you can press CTRL+ALT+V to look at the values in the DataViews.

1 Like

@hmwillett I have looked into this. When i use the Dataview-Filter-Set it loads nothing. when i use the Parent Relationship it get a Server error due to the Query being too large.

Are you calling the BAQ in the event prior to calling the dataview filter? It won’t populate otherwise.

1 Like

Yes i have the baq in the same event but prior to the dataview filter. Using the success path.

In DevTools on the Network tab, do you see an Execute BAQ call and does it show your full dataset?

@hmwillett I have checked the Network tab.
Looks like that BAQ is failing to load which would explain a few things.

image

I am not too sure how to find out why it is failing, it must be to do with DataView-6Filter…

Do you have access to your server?
You could check the Event Viewer on the server for clues.

I have checked the server event log and there are no new events when it the query runs :frowning:
I have removed the filter and the Query still fails.

Any errors here shown in the response packet on the Network tab?

just a generic error.


The query itself runs in BAQ designer and runs really well with criteria applied.

Turn on the remote errors in the web.config file and see what it says.

I decided to try and change tactics as the query was a bit large.
I have managed to trim it but it means i have to filter it from 2 data views.
The BAQ is now loading the full dataset and the Filter isnt kicking in.

I don’t believe the filter shows up on the Network tab. If I recall, it filters the dataset after the fact, so you would have to check it using the CTRL+ALT+V.