Classic EpiCombo Filter From Dataset Not Filtering On Blank

Hey there,

I have an epicombo with bin num filtered by warehouse code. It works fine except that when the warehouse code field is empty I get all bins for all warehouses.

Any suggestions?

Thanks,

Joe

image

image

Is the expected function that you do not get any bins when you do not fill in a warehouse?
I do this with a BAQ to populate the combo. I have a warehouse combo that lists all the warehouses. I can filter in this BAQ to limit results if there are some warehouses I don’t want to be listed. Then I made a Bins BAQ that lists all of the bins from the warehouse selected. Here is the customization code for the dashboard side:

	private void baqComboC1_Leave(object sender, System.EventArgs args)
	{
		if (baqComboC1.Value.ToString()!="")  
		{
		getBins();
		epiUltraComboC1.ForceRefreshList();
		}
	}

	private void getBins()
	{
		cmbBins = (Ice.Lib.Framework.EpiUltraCombo)csm.GetNativeControlReference("886dc91a-429b-4b5b-b900-9e87438facfc");

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

		qeds.ExecutionParameter.AddExecutionParameterRow("Ware", baqComboC1.Value.ToString(), "nvarchar", false, Guid.NewGuid(), "A");

		dqa.ExecuteByID("Bins", qeds);
		if (dqa.QueryResults.Tables["Results"].Rows.Count > 0)
		{
			cmbBins.DataSource = dqa.QueryResults.Tables["Results"];
			cmbBins.DisplayMember = "WhseBin_BinNum";
			cmbBins.ValueMember = "WhseBin_BinNum";
			cmbBins.DropDownStyle = Infragistics.Win.UltraWinGrid.UltraComboStyle.DropDownList;
			oTrans.NotifyAll();
		}
		else
		{
		MessageBox.Show("No Bins in Warehouse!");
		}
	}

With this method you need to setup the BAQs, but don't include parameters in the BAQ. The AddExecutionParameterRow() does that for you.

Can you change it to.

WarehouseCode = '?[BilletWarehouseCode_c]' OR WarehouseCode = ''

I tried these without effect:

WarehouseCode = ‘?[BilletWarehouseCode_c]’ OR WarehouseCode = ‘’

WarehouseCode = ‘?[BilletWarehouseCode_c]’ AND ‘?[BilletWarehouseCode_c]’ <> ‘’

It still returned all bins for all warehouses when the warehouse code was empty.

I already had another warehouse/bin combination working with a baq combo box on the bin number and a parameter linking to the dataset in the query like this:

image

Using this scheme, the query is good for only one code, because the criterion is hardcoded to a single column on the dataset. That’s why I was looking for a filter on the epicombobox.

In the end, I used another baqcombo, copied and modified the query, and went on to something else. :slight_smile:

Thanks, folks.

Joe