BAQ Combo Box not populating

Struggling to do the easiest things these days.. sigh.
Trying to setup a Combo box that is populated by a BAQ. I’ve done this before. Can’t figure out what I’m doing wrong now. I get “No Data Found”. I did set this up as a Key Field. Is that my issue? Everything under Reusable Combo is blank.




Well im fairly new to all of this myself, but if im not mistaken(I could be) you need to add this under reusable combo properties.


Match it with your table.

1 Like

Hi Dan,

Please clear the Reusable Combo properties by selecting null for the Reusable Combo field.
After that, use the Advanced Properties option and try to preview the result.

Sorry I just realized my suggestion was pretty far off, I used those settings and linked a BAQ earlier and looked at the wrong combo box. what you have done in your first images is exactly what I did and it worked for me :man_shrugging:. Thats a weird one

Is the BAQ actually populating with data?

Yes the BAQ works. I will say I just created a blank application and only added a panel card, column, and the combo box. Is there any “initialization” of the form that is needed since I didn’t plop it on an actual existing form?

My crib notes for using a BAQ combo:

-BAQ list : set the following under Properties:
	Data > EpBinding = View.Column e.g. SearchFilters.ProjectStatus
	Advanced > Data Mode = rows
	Advanced > BAQ Query = BAQ id with the results, e.g. ABC-PartClasses
	Advanced > TextField = what shows up in the list, e.g. PartClass_Description
	Advanced > Value Field = the key field, e.g. PartClass_ClassID

Right? So simple. I followed that to the T and I am not getting it to populate. I am going to dump one in a random functional app and see if it’s not related to the fact that I just have an empty app and it needs some kind of initialization or something.

Maybe try a new combo widget? Sometimes something gets corrupted.

It’s got something to do with the fact that I’m using it as a Key field and/or that the form I am using it on hasn’t actually loaded a record yet (it’s a dashboard).
When I put it in a normal form such as ABC COdes and open a record, the combo works just like you’d expect.

2 Likes

Do you have the BAQ linked to anything else? I only mention this as I had linked a BAQ to a grid and a combobox in the past. the result was I could only use the combo box after I had opened my grid in the preview.

Not in that app, no. I was trying to use this as a way to enter a parameter to the dashboard this is used on. So it’s a BAQ that returns all the plants in our company so that a user can filter the main dashboard to results for that plant/site. I use this BAQ within the parameter input to generate a drop-down list of plants. If there’s a more logical way to do that, I would be up for a different way.

For now, I just use the regular parameter slide out that fires automatically. But the thing I don’t like about that is that if I want to refresh the grid, I have to fill them all in again… instead of just changing one value and clicking a refresh button. Or even where you change the value and tab out and then it refreshes. I liked the way that sounded and was trying to make that happen.

1 Like

YES.

Look at your dataviews in app studio. if you started from scratch, TransView doesn’t exist. You have to create it and you have to initialize it (after form load, or whaterver) via a row-update.

Since your combox is tied to TransView, there’s no dataview for it to store the BAQ data returned.

~~
Edit: Well, wait… that might not be true. That might only effect that selecting a value in the combobox wouldn’t be stored anywhere. hmmm :thinking:

2 Likes

Create a DataView “cboPlant”
Create an event “getPlants” to populate this dataview, no trigger. You will call the event with an event-next from some other event that loads at the time you want the combo populated, this could be Form_OnLoad or on a OnCreate_component specific to the page that has the dropdown.
In Event “getPlants” set up a rest-kinetic component that calls Erp.BO.PlantSvc/GetRows, with an empty string for all the whereClause criterias (return all rows), pageSize 0, absolutePage 0, put the output from that call into the “cboPlant” dv.
Now, set up your combo box to feed from the “cboPlant” dataview (set value to be the plant id and display to be the plant name). epBind it to TransView.Filter_Plant.
That populates your filter for plant (you can have other filters that could be textboxes on TransView.OtherFilter, etc.)
Now, create an event to call your parameterized BAQ with no trigger. Call it “getRows”
This event will be called from the Form_OnLoad and from a “Refresh/Apply Filters” button.
In the event, set up a condition, if "{TransView.Filter_Plant}" === "undefined" || "{TransView.Filter_Plant}" === "", on the true branch, set up the kinetic-baq component to run the baq with an empty string in the parameter so it returns all plants (in the BAQ, set the parameter to NOT mandatory, and “dont apply criteria if empty” or whatever that term is.
On the false branch, run the BAQ with the {TransView.Filter_Plant} as the parameter.

Apply similar logic to additional fields you want to filter on.

2 Likes

I did create the TransView dataview so that’s not the issue. The initializing is what I was primarily wondering about. If the data view were initialized and I was in an active row, then the box would probably light up and allow me to select the drop-down without marking it as a Key Field. But I still don’t know how to “initialize it” nor do I know without learning that and doing it if that will solve the problem or not.

I saw some posts about using a dataview to populate combo boxes with a huge number of values. I didn’t pursue it because that didn’t apply to me and the setup seemed like a lot of work for what should simply work using the combo box with the BAQ ID filled in. However, given that it has not worked yet and I have proven that it’s the result of how I’m working on this particular dashboard/app, I am going to give this a shot. Maybe this is what’s needed for a dashboard in the situation I am working on.

Do a row-add to that dataview, set some field to some value, doesnt have to exist.

{
  "id": 1
}
1 Like

I will try this first. If that still leaves me hanging, I’ll try creating a new dataview for my Combo Box as you suggested. Thanks a bunch!