in classic we have a dashboard and when you click a button it creates a material request queue item and then operators using kineic mobile warehouse can move the material as required to wherever its new location will be.
this works flawlessly in classic but when calling the exact same method from a kinetic button, it is duplicating the request every time.
these are the custom actions:
the code is as follows:
string requestType = "MI";
string warehousesList = string.Empty;
string defaultBinNum = "PUTAWAY";
List<string> binIssues = new List<string>();
foreach (var toProcess in queryResultDataset.Results.Where(r => r.Calculated_Select))
{
var tsMoveRequest = new MoveRequestTableset();
using (var hMoveRequest = ServiceRenderer.GetService<MoveRequestSvcContract>(Db))
{
decimal pdRequestQty = actionID == "ProcessIn" ? String.IsNullOrEmpty(toProcess.PartBin_LotNum) ? callContextBpmData.Number01 : toProcess.PartBin_OnhandQty : toProcess.PartBin_OnhandQty;
string toWhse = actionID == "ProcessIn" ? callContextBpmData.ShortChar01 : toProcess.PartPlant_PrimWhse;
string toBin = actionID == "ProcessIn" ? callContextBpmData.ShortChar02 : toProcess.PlantWhse_PrimBin;
if (String.IsNullOrEmpty(toBin))
{
bool defaultBinExists = Db.WhseBin.Where(r => r.Company == toProcess.PartBin_Company && r.WarehouseCode == toWhse && r.BinNum == defaultBinNum).Any();
if (!defaultBinExists)
{
binIssues.Add($"PartNum = {toProcess.PartBin_PartNum}, LotNum = {toProcess.PartBin_LotNum}");
continue;
}
toBin = defaultBinNum;
}
if (toProcess.PartBin_WarehouseCode == toWhse && toProcess.PartBin_BinNum == toBin) continue;
hMoveRequest.GetNewMoveRequest(requestType, ref tsMoveRequest);
hMoveRequest.OnChangePartNum(toProcess.PartBin_PartNum, ref tsMoveRequest, out warehousesList);
hMoveRequest.OnChangeRequestQty(pdRequestQty, ref tsMoveRequest);
hMoveRequest.OnChangeFromWhse(toProcess.PartBin_WarehouseCode, ref tsMoveRequest);
hMoveRequest.OnChangeFromBin(toProcess.PartBin_BinNum, ref tsMoveRequest);
hMoveRequest.OnChangeToWhse(toWhse, ref tsMoveRequest);
//if (String.IsNullOrEmpty(toBin)) ;
hMoveRequest.OnChangeToBin(toBin, ref tsMoveRequest);
if (!String.IsNullOrEmpty(toProcess.PartBin_LotNum)) hMoveRequest.OnChangeLot(toProcess.PartBin_LotNum, ref tsMoveRequest);
tsMoveRequest.MoveRequest.FirstOrDefault().EmpId = toProcess.Calculated_Employee;
hMoveRequest.ProcessRequest(ref tsMoveRequest);
}
}
if (binIssues.Any())
{
PublishInfoMessage($"The following records have failed processing because there is no default bin against the part and the Bin {defaultBinNum} does not exist in the part's default warehouse.{Environment.NewLine}{Environment.NewLine}{String.Join(Environment.NewLine, binIssues)}",Ice.Common.BusinessObjectMessageType.Warning, Ice.Bpm.InfoMessageDisplayMode.Individual, "LineSequencing", "Process" );
}
PublishInfoMessage($"Processing completed",Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "LineSequencing", "Process" );
can anyone see why it would be duplicating in Kinetic or what i need to do to stop it duplicating when it does not duplicate in Classic?