Dynamic Combo boxes in Kinetic

In classic I used dynamic combo boxes all the time in my dashboards. We often start with a user-provided value like part number from a text box. This is used to populate and filter the subsequent combo boxes. For example, when the user types in a part number and leaves that field I trigger an event to look at the value they typed in and if it isn’t blank, use that as the parameter for a BAQ that populates the part revision combo box. In classic I would use this:

   private void MyPartNum_Leave(object sender, System.EventArgs args)
   {
   	// ** Place Event Handling Code Here **
   	if (MyPartNum.Text!="")  
   	{
   	getRevs();
   	cmbRevs.ForceRefreshList();
   	}
   }

private void getRevs()
   {
   	cmbRevs = (Ice.Lib.Framework.EpiUltraCombo)csm.GetNativeControlReference("a03dd350-74a0-4382-b1cb-251c5e41ed9a");

   	DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
   	dqa.BOConnect();		
   	QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("getPartRev");
   	qeds.ExecutionParameter.Clear();

   	qeds.ExecutionParameter.AddExecutionParameterRow("part", MyPartNum.Text, "nvarchar", false, Guid.NewGuid(), "A");

   	dqa.ExecuteByID("getPartRev", qeds);
   	if (dqa.QueryResults.Tables["Results"].Rows.Count > 0)
   	{
   		cmbRevs.DataSource = dqa.QueryResults.Tables["Results"];
   		cmbRevs.DisplayMember = "PartRev_RevShortDesc";
   		cmbRevs.ValueMember = "PartRev_RevShortDesc";
   		cmbRevs.DropDownStyle = Infragistics.Win.UltraWinGrid.UltraComboStyle.DropDownList;
   		oTrans.NotifyAll();
   	}
   	else
   	{
   	cmbRevs.DataSource = "";
   	cmbRevs.DisplayMember = "";
   	cmbRevs.ValueMember = "";
   	oTrans.NotifyAll();
   	MessageBox.Show("Part Not Found in Any Open Jobs!");
   	}
   }

How do I set the value BAQ source, display field, and value field for the unbound combo box?

1 Like

I believe Hannah has a thread about doing something like this in Kinetic. I’ll see if I can find it in my squirreled away notes.

1 Like

Guess it was Kevin L https://www.epiusers.help/t/dynamic-combo-bpm-form-proof-of-concept-kinetic-classic/103993 one of the other super smarties I crib from all the time.

2 Likes

Reading that solution makes me want to cry. This is all so terrible. Just terrible.

2 Likes

The version I did used dataviews to populate the combos.
You can use a ColumnChanged event from the first combo epBinding to trigger a dataview-filter-set on the next dataview bound to the combo.

Somewhere in there:
BAQ Combo customization - how to convert from Classic to Kinetic - Kinetic ERP - Epicor User Help Forum

4 Likes

Hannah’s link is the one I’d try first.

1 Like

So would I create a dataview for each unique combo box?

My BAQ that populates one of my combo boxes is a simple parameter driven BAQ:

select 
	[PartRev].[RevisionNum] as [PartRev_RevisionNum],
	[PartRev].[RevShortDesc] as [PartRev_RevShortDesc]
from Erp.PartRev as PartRev
where (PartRev.PartNum = @part)

In classic I would define the parameter with this line: qeds.ExecutionParameter.AddExecutionParameterRow(“part”, MyPartNum.Text, “nvarchar”, false, Guid.NewGuid(), “A”);

How do I do this in Kinetic? I have created a dataview to popluate the ParRev combo box. dvPartRevs. I used the built in wizard and it created the DV and a get event for that DV. Neat!

But I still can’t figure out how to apply my value from a txt box as the parameter feeding the next combo box. I created an event myPartNum_onBlur. The first thing it checks is if you put a value in the text box. If you did, then it should use that value to filter the PartRev BAQ.

I created that dv for the revision combo box. called dvPartRevs. I created the event myPartNum_onBlur. I added the dataview-filter-set to this event (only fires if PartNum is not empty). I set the dv to dvPartRevs and the filter to PartRev_PartNum=‘{TransView.myPartNum}’. I can see that my part number is going into the filter correctly, but my combo box never populates. I can see the headers, but no values.

How do the EpBinding and the dataview relate to each other in regards to this combo box? I have set the EpBinding for the combo box to TransView.myRev.

My thinking is that TransView temporarily holds whatever the user inputs/selects from combo boxes. Once TransView has all the data needed for a new record, the user can click the add record button and a UBAQ BPM would pull the data from the transview and populate the UD table. I haven’t gotten to this part yet, I just need to get the combo boxes to populate correctly.

Yes, and then reference the each here:

As of 2025.1, the only way you can specify parameters to send to a BAQ is with the ```kinetic-baq`` event widget (or whatever the name du jour is).

Presumably, you set your epBinding on ComboBox1 (let’s call it TransView.C1).
You would have a ColumnChanged event on TransView.C1.
Within that event, you can call your BAQ with the kinetic-baq widget and specify the value for the parameter here:

Following that, rinse and repeat: create a new ColumnChanged event for your second combo bound to TransView.C2 (or whatever) and repeat the steps.

The epBinding holds the selected value.
The dataview holds the data available to show in the dropdown.

3 Likes

So I have found it cleaner and simpler to just use a text box, and then click Enable Search under advanced options. You can then configure a baq search in your on search click behavior, and preload the search filter with your parameter. Yeah I know, its not a combo.

5 Likes

Depends on how many combos he needs chained.

Also, Kinetic BAQ-search is absolute trash.

2 Likes

I suppose there’s no hope for a combo that filters as you type - ideally server-side so it doesn’t take forever to load options I don’t need. pretty common pattern in web frameworks (including kendoUI).

2 Likes

I think Kinetic will do this eventually. It sounds like maybe the filter part of the combo box isn’t working yet:
Kinetic Control Compendium - Experts’ Corner - Epicor User Help Forum

1 Like

Yeah I was reading that last night and thinking about trying to set .rowFilter property in an event, but I think the problem is which event triggers upon typing in the combo? AFAIK, the only one is onColumnChanging for a dataView, maybe?

related:

1 Like

PS - I wonder if this flag allows/disallows the built-in grid filter controls for the column?

Comforting Big Hero 6 GIF by Sky

Well if it makes you feel better, that demo was specifically for adding a dynamic combo to a BPM form, because they are not customizable in Kinetic. That method was never intended to be used for regular combo boxes.

Hannah’s example with the events is the way to go.

5 Likes