I’m having trouble finding any documentation or postings of OrderAllocData, and what exactly is supposed to be contained within the search results. I’m looking in the REST v2 API help (Swagger) and I don’t see anything in there. I’m in a classic UI customization and all I really need to know is, if a PartAlloc record exists that matches an Order/Line/Release, what the picking quantity in that record is.
I’ve tried OrderAlloc.Count.Rows, PartAlloc.Count.Rows, and OrderAlloc.Rows and PartAlloc.Rows without the Count and nothing seems to give me anything but zero.
My attempt at a Click event handler is below; grateful for any help.
Thanks,
…Monty.
private void btnShipPicking_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
int intOrderNum;
Erp.Adapters.OrderAllocAdapter adpOrderAlloc = new Erp.Adapters.OrderAllocAdapter(oTrans);
string strSearch;
Ice.Lib.Searches.SearchOptions opt = new Ice.Lib.Searches.SearchOptions(Ice.Lib.Searches.SearchMode.AutoSearch);
opt.DataSetMode = Ice.Lib.Searches.DataSetMode.RowsDataSet;
adpOrderAlloc.BOConnect();
// move down to where we have O/L/R
// get pack number
if (edvShipDtl.HasRow)
{
string strPackNum = edvShipDtl.dataView[0]["PackNum"].ToString();
try
{
foreach (DataRowView rowView in edvShipDtl.dataView)
{
DataRow row = rowView.Row;
row.BeginEdit();
row["DisplayInvQty"] = 0; // start each pack line's qty at zero
// then look up picking qty by O/L/R in PartAlloc if it's there
// strSearch = "Company = '" + ((Ice.Core.Session)oTrans.Session).CompanyID
// + "' AND DemandType = 'Order"
// + "' AND OrderNum = '" + row["OrderNum"].ToString()
// + "' AND OrderLine = '" + row["OrderLine"].ToString()
// + "' AND OrderRelNum = '" + row["OrderRelNum"].ToString() + "'";
strSearch = "OrderNum = '" + row["OrderNum"].ToString() + "'" ; // temp simplification for testing
opt.PreLoadSearchFilter = strSearch;
adpOrderAlloc.ClearData();
adpOrderAlloc.InvokeSearch(opt);
MessageBox.Show("search string " + strSearch + " and rows = " +
adpOrderAlloc.OrderAllocData.OrderAlloc.Count.ToString());
if (adpOrderAlloc.OrderAllocData.OrderAlloc.Rows.Count > 0) // found matching row(s)?
{
for (int i = 0; i < adpOrderAlloc.OrderAllocData.OrderAlloc.Rows.Count; i++)
{ // should be only one matching row
row["DisplayInvQty"] = adpOrderAlloc.OrderAllocData.OrderAlloc.Rows[i]["PickingQty"];
} // end for (each matching order alloc row, should be only one)
row["DisplayInvQty"] = 1; // temp just to signal us when we finally get search results
} // end if matching OrderAlloc rows found
row.EndEdit();
} // end for each row in data row view
} // end try
catch
{
MessageBox.Show("search error");
}
} // end if row exists in edv
oTrans.Update();
} // end click event handler
Best answer by MontyWilson
View original