Combo based on BAQ

I’ve heard that the BAQCombo control has been deprecated. Is there really no simple way to use the epiCombo or the epiUltraCombo to pull list items from the results of a BAQ? I’m trying to make all of my filters on my deployed dashboard more user friendly and I’m a bit stymied.

Create yourUltraCombo and use the Event Wizard on the BeforeDropDown method

Example without parameters:

private void yourUltraCombo_BeforeDropDown(object sender, System.ComponentModel.CancelEventArgs args)
{
	// ** Place Event Handling Code Here **
	try
	{ 
		DynamicQueryAdapter queryAdapter = new DynamicQueryAdapter(this.oTrans);
		queryAdapter.BOConnect();

		string queryID = "yourBAQ";

		queryAdapter.ExecuteByID(queryID);

		yourUltraCombo.DataSource = queryAdapter.QueryResults.Tables["Results"];

	}
	catch (System.Exception ex) 
	{ 
		ExceptionBox.Show(ex); 
	}
}

Example with parameters

	try
	{ 
		string orderNum = this.edvShipHead.CurrentDataRow["OTSOrderNum"].ToString();

		DynamicQueryAdapter queryAdapter = new DynamicQueryAdapter(this.oTrans);
		queryAdapter.BOConnect();

		string queryID = "yourBAQ"; // Change to your BAQ.  BAQ must have parameters matching below.

		QueryExecutionDataSet parameters = new QueryExecutionDataSet();
		parameters.ExecutionParameter.AddExecutionParameterRow("orderNum", orderNum , "int", false, Guid.NewGuid(),"A");

		queryAdapter.ExecuteByID(queryID, parameters);

		yourUltraCombo.DataSource = queryAdapter.QueryResults.Tables["Results"];

		//yourUltraCombo.DataSource = queryAdapter.QueryResults.Tables["Results"].DefaultView.ToTable(true, "OrderDtl_ShortChar04"); // Returns unique list for named Column.


	}
	catch (System.Exception ex) 
	{ 
		ExceptionBox.Show(ex); 
	}
1 Like