I am attempting to AutoReserve orders. Using Erp.Contracts.BO.OrderAlloc, I call GetListOfOrders(), which returns the OrderAllocListDataSet. This OrderAllocListDataSet gets passed to the OrderAllocationGetRows() method, returning the OrderAllocDataSet. This OrderAllocDataSet gets turned into a SlimOrderAllocDataSet and then gets AutoReserved.
The issue that is occurring is the OrderAllocDataSet, and all subsequent data, is orderd by ShipByDate Date. Trying to use traditional methods to reorder the DataTable inside the DataSet (using .sort on the DataView, using .select(), etc) allow the DataTable in the DataSet to be reordered as a generic DataTable, but not as an OrderAllocDataTable. This does not allow it to be reserved properly when calling AutoReserve(). It doesn’t throw an error, it just doesn’t reserve.
So the holy grail would be to find a way to reorder the OrderAllocDataTable (That lives inside the OrderAllocDataSet) without converting it to a DataTable.
Thank you for your help regarding this.
Erp.Proxy.BO.OrderAllocImpl oa = Ice.Lib.Framework.WCFServiceSupport.CreateImpl<Erp.Proxy.BO.OrderAllocImpl>(session, Epicor.ServiceModel.Channels.ImplBase<Erp.Contracts.OrderAllocSvcContract>.UriPath);
//Setting Parameters for intial GetListOfOrders. This returns the orders to be reserved, as a OrderAllocListDataSet
string waveWhereClause = String.Empty;
string orderHedWhereClause = "OrderHed.OrderHeld = false";
string orderDtlWhereClause = String.Empty;
string orderRelWhereClause = "OrderRel.ReqDate <= '" + DateTime.Now.AddDays(21).ToString("MM/dd/yyyy") + "'";
string customerWhereClause = String.Empty;
string partAllocWhereClause = "NoFilter,NoFilter,NoFilter,NoFilter";
string countryWhereClause = String.Empty;
string shipToWhereClause = String.Empty;
string creditHoldClause = "NoFilter";
string i_SortByOrder = String.Empty;
string i_SortByWarehouse = String.Empty;
string i_SortByAllocation = String.Empty;
//This determines how many order records are brought back. 0 brings them all back
int pageSize = 10;
int absolutePage = 0;
bool morePages = false;
string NO_Company = String.Empty;
//Getting orders to reserve
Erp.BO.OrderAllocListDataSet OrderAllocDS = oa.GetListOfOrders(waveWhereClause,
orderHedWhereClause, orderDtlWhereClause, orderRelWhereClause, customerWhereClause, partAllocWhereClause,
countryWhereClause, shipToWhereClause, creditHoldClause, i_SortByOrder, i_SortByWarehouse, i_SortByAllocation, pageSize,
absolutePage, out morePages, NO_Company);
Erp.BO.OrderAllocDataSet oaDataSet = oa.OrderAllocationGetRows(OrderAllocDS, 0);
//Some massaging of data occurs here, to get the OrderAllocDataSet to a Slim OrderAllocDataSet
oa.CheckDates(SlimOrderAllocSet, out cMessageText);
oa.AutoReserve(SlimOrderAllocSet, cIPWhseList, CWhseType, out cMessageText);