Application Studio BAQ Grid not loading records, but BAQ does, Involves sub-query

Your local neighborhood dummy again.

I built a BAQ that loads fields from QuoteHed and connected tables, well really I borrowed one developed by the Epicor implementation team and added a few more fields. I can run my new BAQ and see records just fine.

I wanted to now open Application Studio and use the Wizard (you’re a Wizard App Studio…) to create a page that would load my BAQ results. Eventually I will add more customization to this page but I wanted to start with the most basic step first.

  1. I created a new Application Studio
  2. Used Wizard option
  3. I gave it a name “Tory_QuoteList”
  4. Selected the BAQ “Tory_QuoteDashboard” in the Data Source Details
  5. Typed in a sensible name for Data View Name “Quotes”
  6. On Grid Details I edited the Title to “Quote List” and just clicked “Next”
  7. On the “Form card details” page I unchecked the “Add a Form Card”
  8. Clicked “Next” and completed.

Then I went to run the page, and nothing loads in the grid.

Did I do something wrong?

Edit: This BAQ has a sub-query. I just tested a version of the BAQ without the Sub-query and it worked fine. Is there something special about Grid panels loading data with Sub-queries? Do you need details on the sub-query to give help?

The short answer is, the Wizard you used is a little more “Ron” than it is “Hermione”.

This can be frustrating… you didn’t do anything wrong. Playing around with the wizards a couple weeks ago I saw two paths.

The Wizard at the start of App Studio “Path A” creates your first DataView, even gives you a dataview grid… but doesn’t create a “get” event to populate it.

Another method “Path B” - I’ll expand on a little more because you took “Path A”(read through because there’s another gotcha) … looks like this…

Instead of using the Wizard right off the bat… you manually create a dashboard. Choose Dashboard as the type, and then give it a name in the ID field.

Once created and loads, then click on the DataView icon and click NEW. You can use the DataView Wizard HERE (we’ll call this one “Harry”), instead.

Source Type: BAQ
Choose your BAQ… give it a name… Next

When you do it this way, you’ll notice the next screen looks like this:

Not only is the Wizard creating the DataView, but also an event to populate the dataview.

HOWEVER… in THIS route (“Path B”), we manually created the Dashboard, but it didn’t give us the LandingPage Grid that “Path A” gave us. So, you have to manually add that to your form, set it up to your BAQ DataView, etc.

PLUS… the Get event is not set to a trigger. So you have to either give it a trigger, or create another event that fires when you want (after form onload, for example) and then tack this event on as an event-next.

image

So…
“Path A” (Ron) gives you your dataview and a grid, just not the event.
“Path B” (Harry) gives you a dataview and event, but not your grid.

Either way, you have to build out from there.

Since you already started down “Path A” you just need to create a new event mimicking the one above which performs the call that uses your baq to fetch data and fill in your BAQ DataView.

Maybe someday they’ll build this out and give us “Hermione”, but for now, you have to go with either “Ron” or “Harry” and deal with their flaws.

Hope this helps.

7 Likes

Excited Season 6 GIF by The Office

6 Likes

image

4 Likes

Thank you for playing along with the Wizard analogy, that was fun and engaging :slight_smile:

Thank you, I was looking at the dashboard created by the Epicor team and noted an event. I was beginning to think this is where the issue was. When I looked at the event it seemed empty, but I will do a little more digging, thanks for the direction.

I did create a DataGrid based on BAQ from a more simple BAQ that functioned using Method A without any extra, so it does function in the more basic BAQ model at least.

I do some programming, but the language and techniques I use are very outdated. Time for this old dog to learn some new tricks.

1 Like

In my exploring App studio, There are different 'Wizards ’ for Dashboards and Apps. I noticed the App wizard walks you through a 'Form and or Grid Creation. The dashboard wizard does not have a form creation.

Could be where some of the wondering comes from ??

Yes with the Wizard though, you have to create a trigger for the ,YourDataviewNameHere>_Get that the wizard creates. It can be a field On Blur, button press or a myriad if other events ( to yet be discovered…)

How do you bind a view to a grid?
I took Path C, because I like to make a mess I guess.
I worked in my Path A option and created a dataview with the Wizard like Path B, but can I now assign my new dataview to the Grid that was created in Path A? In looking at the properties nothing is obvious to me as to how to assign a specific dataview to the grid… I’m sorry if this is as obvious as the dumb written all over my face, but thanks for any help.

On your panel card grid… go to Data > Grid Model

Scroll down to the bottom and open Provider Model
Ep Binding: The name of the DataView you created.
I’m assuming it should already contain the name of the View you created when you started Path A… so you’ll need to change it to the View you created in your “Path C” :rofl:

Description: Not sure if this is required or not… Perhaps just mimic what was already there but tweak for your new BAQ/View?

Now… Scroll down, near the bottom, you’ll see
BAQ ID: You should, again, see the BAQ name you used in Path A. Change this to the BAQ from Path C.

If there are any where clauses on your BAQ, you can enter those by clicking the next setting down and going in to “BAQ Options”. You add your Where clause there, or can do a Where List if you have many different criteria.

Since you’re hijacking a previously built grid… I have to assume you have to rebuild all the columns you want displayed as the current grid will be calling out columns from the first BAQ (Path A).

So you’ll have to go back to the beginning to Data > Grid Model > Columns.

You’ll have to clear out what’s in there and then add your NEW columns back in. Build these in the order you want them displayed! You can’t really change the order later outside of deleting them and recreating them again in the order you want. So, try to get that figured out on your first pass.

You should just really need the “Field” from your BAQ, and a “Title”. If you need help on the format, it should match the Column that’s in your data view. So if you want your QuoteNum… you would enter: QuoteHed_QuoteNum

The Title is whatever you want displayed on the header row of the grid: Quote for example.

HAVE FUN!! :upside_down_face:

Hit us back if you run into any issues.

1 Like

.

Not sure how I got the first grid to load data - it just did.

When I added a new data view made a get event however once I closed it I cant get back to it

The first data view and grid (that I set up manually) just worked. I set the data view to connect to a BAQ, added a panel grid then used the guided setup and it just worked. Do this same with the second BAQ and it does not try to load records.

Building a new application same thing, the grids just will not load, nor will combo boxes. Very confusing. The BAQ works fine on its own and in a customization but cannot for the life of me get it to load in Application Studio. I cant imagine an non IT person being able to figure this out.

My assumption is that if it built the event for you it would be named: “Yourdateviewname_Get”

That’s what it did for me:
image

So, if you went into the events and did a search for whatever your DataView name was, it should show up.

This, I’ve not seen. There’s always been option sets to choose from. Maybe closing it and going back in will end up being a good thing. Maybe it’ll fix itself and they’ll be there.

It has a few things but nothing of obvious use and if I close the tab the get event is gone not sure how to get it back. I told it to run the get event after refresh all but that doesnt do anything.

It can’t be this hard to run a BAQ.

Getting the same with drop downs. Just nothing. Set it to a reusable combo and it picks the files. Preview the app and nothing. Its not even selectable. I know the table has data.

I can find it but it doesnt seem to do much. And then it vanished when I closed and reopened designer. After I saved.

There has to be an easier way to do this. All I want is a grid to load the query data and drop downs to show the table they are bound to. This makes zero sense.

Fun fact you cant just have a combo box. Even one of the reusable combo boxes. It has to be bound to a field. So I put some hidden calculated columns on the BAQ just so the combo box would work. Still trying to figure out how to get a grid to auto show data.

Okay… so let’s start from the beginning… here’s an example:

This is just a very simple dashboard I created to show OnHand Inventory “at a glance” and users can easily sort/filter by part number, description, Bin, etc.

Anyway… I’m assuming this is probably how your first grid is set up which the wizard set up for you.

I have a grid:

In the Grid Model, I really don’t have any settings:

I DID set up my columns here. But the main portion of the set up is in Provider Model. In this case, the “dashboard wizard” created a dataview and it tied that dataview to the grid here:

image

Down towards the bottom of Provider Model, I give it the BAQ to use.
image

That’s it. If you have where clauses, etc. you want to apply, you can do that in the BAQ Options here… but in this case, I did all my pre-filtering in the BAQ itself.

When you create a dashboard from scratch, remember that there is NOTHING there (basically). No on-form load events, not even a TransView dataview. You need to set that all up.

So, I created a Window onLoad event:

It’s basically just an empty event. It runs when the window loads, but there’s nothing in it. (no actions taking place).

I then created a second event for AFTER Window onLoad. I may have been able to do this all in just the Window onLoad event, but I wanted to leave onLoad open in case I wanted/needed to do things later (well, earlier in this case).

Anyway… my AFTER event looks like this:

So, after the window onLoad, it starts this event… which basically kicks off two others. One to initiate TransView (all pre-programmed apps have a TransView, but when you build your own, you have to set this up yourself), and a second to kick off the “get” event that the wizard created for me.

In Dev Tools in the browser, I can watch these events fire:
image

The erp-baq (get) event runs the BAQ, and it loads the dataset into the dataview I assigned earlier.

Here’s a second example. This is just a BAQ grid (no dataview involved).
No EpBinding to a view… just a BAQ:

The grid is on a secondary form I’m opening with a button event:
image

When I click the button, the slider opens… and yes, the BAQ runs automatically when that form slides open.
image

I can see it run in the Network tab of the Dev Tools:

Can you show me where you are in your build? Maybe we can find where it is breaking down.

1 Like

Thanks for the help.

I figured it out after playing with the Kinetic course

  1. Create New Application.
    If you do the guided setup you can also define the data view here.

  2. Add Panel Card Grid to the landing page.

  3. Expand the Basic property group and set Title to something meaningful. I was using a Parts with GTINS BAQ so used that as a title.

  4. Open Data > Grid Model and set ID to something meaningful like grdPartsWithGTINS

  5. Now, go to Data > Grid Model > Provider Model and set Baq ID to your BAQ name. There is no wizard here so you either have to know it, or copied it to the clipboard from step 1.
    You can preview now to make sure it works.

  6. Then do go back to the first level of properties and select Guided Setup. Select the data view and select which columns you wish to see.

If I created the view first then created the grid then used guided setup it failed.
It just would not load data.

However I was able to add a new grid to the non working application page and get it to work following these steps in addition to creating an application from scratch.

Looking through the events, it did not create a get event.

1 Like

When you first create a new event, it will get the “NewEvent” name. When it opens, click the name in the designer, you should see a blue box around it to see it is selected. Then you should be able to change the name/ID in the properties area. Once you save the event, it is locked and you can’t change the name, so it is good practice to do this first.

TransView is just a generic runtime DataView. It only exists during the session and doesn’t really have any functionality by default. But it is handy as a placeholder DataView. So, you can run various events and assign values to columns within the TransView dataview by setting their EpiBinding. For example TransView.MyColumn.

This is not a database table. Just a dataview that can hold a value so you can use it else where in your events. Think of it as a temp table, I guess.

Its not required. I was just stating that all system forms already have it built and available… but if you create a dashboard from scratch, it doesn’t exist. You have to create it yourself and initialize it with an event (if you want it).

I MIGHT understand what’s going on here, but you can tell me if I’m wrong.

The “event-next” is just a pointer. So, in event “A”… you tell it at a specific point, to run another event (“B”). You’re not going to set any parameters for Event “B” here… you’re just telling it what event to run next (“event-next”).

Here’s an example of the “GetNew” event in Part Maintenance (Event “A”):

It has a condition, and if false… event-next: SysSetUIFormEventType (event “B”). So the application then runs event “B”.

When event “B” is complete… it comes back to event “A” and looks for what to do next. Well, in Event “A”, the next step is another event-next: PerformUpdate (event “C”).

So, it then runs event “C”. When it is done, it comes back to Event “A” and if event “C” was successful, move forward and do the next step… which is another event-next: BeforeGetNew (Event “D”).

Each of those events, B, C, D, etc. need to be created first and designed as independent events. Event “A” is just telling the application the order in which to run those other events.

So… with this in mind, if I’m reading your response correctly…

You’re not going to see any drop downs to define the get method IN the event-next properties. The event-next will call you GetNew event.

You’ll need to go into your GetNew event and set up any get method parameters there.

The “Views” in the image below (I’m assuming is what you mean) can be set up to give your users different pre-defined/pre-filtered views they can select from.

Here’s an example from Job Entry:

image

The user can choose one of these default “views” to see ALL jobs, only Firm jobs, only UnFirm jobs, etc.

That’s what that portion of the guided set-up is doing. It is giving you the opportunity to build those pre-defined views upfront. You don’t have to do this step (you can always add them later if you wish).

Anyway… this response it way too long winded… can you show me snips of your Grid Model properties? Both Grid Model and Provider Model?

3 Likes