I’m attempting to recreate the functionality of the Transfer Order Workbench in a function. I have an updateable BAQ that feeds a dashboard that allows the user to mark the OrderFirm field for the suggestions they want to create orders for. There is a button on that calls the following function to create the orders:
if(resultDS.Tables[0].Rows.Count > 0)
{
Erp.Tablesets.TransferWorkBenchTableset TODS = new Erp.Tablesets.TransferWorkBenchTableset();
this.CallService<Erp.Contracts.TransferWorkBenchSvcContract>
(
bo =>
{
foreach(DataRow baqRow in resultDS.Tables[0].Rows)
{
if(Convert.ToBoolean(baqRow["TFOrdDtl_OrderFirm"]) == true)
{
TODS = bo.GetByID(baqRow["TFOrdDtl_TFLineNum"].ToString());
TODS.TFOrdDtl[0].CreateOrder = true;
TODS.TFOrdDtl[0].RowMod = "U";
bo.OnChangeFirmSuggestion(true, ref TODS);
bo.SetDefaultShipVia(ref TODS);
TODS.TFOrdDtl[0].OrderFirm = true;
TODS.TFOrdDtl[0].Selected = true;
bo.ProcessNewSuggestions(ref TODS);
}
}
}
);
This works very well to process each line individually. The one thing I can’t seem to figure out is how to mimic the process where in theTransfer Order Workbench, if the suggestion is for the same part number and the same from and to sites, it will create one order with lines for each suggestion. My function creates a separate order for each suggestion in this scenario. I’ve already begun working on an alternate approach but was curious if anyone had any thoughts on this.