Multiple Results on a search

I have a button which launches a a Search on the Sales Order Adapter. I added this through the wizard as a simple search. The search will only allow me to return one record at a time. I want to be able to select like 5 or more rows at a time and then be able to flip through them. How can I modify this code to achieve that?

	private void SearchOnSalesOrderAdapterShowDialog() 

		bool recSelected;
		string whereClause = string.Empty;
		System.Data.DataSet dsSalesOrderAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "SalesOrderAdapter", out recSelected, true, whereClause);
		if (recSelected)
			System.Data.DataRow adapterRow = dsSalesOrderAdapter.Tables[0].Rows[0];
			tbOrderOrderNumRef.Text = adapterRow["OrderNum"].ToString();
			tbOrderLineRef.Text = "1";
			tbOrderPONumRef.Text = adapterRow["PONum"].ToString();
			var myCustomDV = oTrans.Factory("MyCustomOrderView");
			myCustomDV.dataView[myCustomDV.Row]["OrderNum"] = tbOrderOrderNumRef.Text;

Can I ask why you created the button and didn’t set up a Quick Search?

1 Like

It is on a Ud40 table. There is a quick search setup on it. That button launches the quick search. It’s showing all the records but it will only let me select one at a time

Shannon Kearney

Are you saying that the physical search window will only let you select one record at a time? Like you can only highlight one?

Or you just can’t use the toolbar to pan through all the records you initially selected?

It may be a limitation of the UD table and what it can return.

So the serach window pops up to use my Quick Search on the Sales Order Adapter as it should. However I can’t select more than one record to return to my form. So, yes I can only highlight one record at a time. I want to be able to select multiple and then scroll thru them.

It isn’t a limitation of the UD Table. I’m not searching the UD Table I have a customization over it in which I call the Sales Order Search and in the base form it works correctly. It is something in the way I am calling the Search Adapter.

It will let me do it on the Sales Order Entry Screen using the same quick search.

So you are saying it will let you do the Quick Search and select multiple records if you do the quick search from the Sales Order button but not from a button you created using the same data, correct?

I tried looking into this last night. It appears that the method you are using is deprecated. So I’m assuming there is a newer way. However i couldn’t seem to find what the newer way was. My gut was telling me it had to be something similar to a parameter you set similar to FileDialogs.

this.openFileDialog1.Multiselect = true;

SalesOrderAdapter.ShowSearch() seemed like the way to go for a new way, but I had lots of trouble trying to implement it. It expects a callback function that I was unable to get working in the second argument. I couldn’t seem to find anyone else doing it another way. So perhaps i was looking for nessy.

No not what I’m saying

what is final anser for this can u please share

Take a look at @hkeric.wci post here

Hes a wizard…

SearchFunctions.listLookup has overloads!

public static DataSet listLookup(object Sender, string adapter, out bool recordSelected, 
                                 bool showSearch, string whereClause, **bool multiSelect**, 
                                 string primaryTableName)