I’m trying to get the OrderAllocList dataset for only one row. I’m using the GetListOfOrders method in the OrderAlloc adapter to achieve this, but the filter in the whereclause doesn’t seem to be working. When displaying the row count it’s showing the count of all the OrderAllocs that are available, even though i expect it to be only 1.
I also tried using GetRows, GetList, InvokeSearch methods with the same filter but without any luck.
Before you call GetListOfOrders(); you need to run the search option filter. If you run the following it should invoke the search and only return the where clause rows.
I tried adding the InvokeSearch method before executing the GetListOfOrders. Unfortunately this didn’t solve the issue either. After printing the count of rows of oaDs.OrderAllocList it still shows all rows and the count of the oaAdapter.OrderAllocList.OrderAllocList is 0.
I also tried executing the method with the same Whereclause in the BLTester. In here it does work and it shows 1 row in the Results tab.
I’ve run into the same issue. This particular data adapter doesn’t work with the search options in Epicor 10.2.300.10. No errors display so, not sure why this adapter works differently than other adapters. However, it is different from other adapters. Since Epicor doesn’t invest in detailed documentation of their adapters for screen customization, I did research based on this article on how to work with this adapter. What I found is that it is unlike any other adapter I have worked with in Epicor. In short GetLIstOfOrders needs to be passed as a parameter to this convoluted version of the Search engine. Below is sample code of how I got it to work.
_adOrderAlloc.BOConnect();
bool morePages;
Ice.Lib.Searches.SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
//Some very "Special" set up for doing searches with this adapter that are not documented anywhere
//and is different than any other adapter we have worked with.
_adOrderAlloc.DefaultSearchType = Erp.Adapters.OrderAllocAdapter.SearchType.SO;
_adOrderAlloc.SearchForm = new Erp.UI.Searches.OrderSearchForm();
opts.SearchMethod = new AlternateSearchMethod(_adOrderAlloc.GetListOfOrders);
opts.SelectMode = SelectMode.MultiSelect;
string _filter = "OrderNum = " + OrderNum.ToString() + " AND OrderLine = " + OrderLine.ToString();
opts.PreLoadSearchFilter = _filter;
_adOrderAlloc.InvokeSearch(opts);
//Need to mimic the client and set the row and dataset
_adOrderAlloc.OrderAllocationGetRows();
As you can see, in the case of this adapter, Epicor did not follow the coding standards they established with other adapters. Just another example of why we need to let Epicor know that they need to provide better technical and design documentation for doing customizations.