Kinetic uplift UBAQ Directive duplicating action

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:
image

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?

1 Like

Add log message inside foreach, how many times it is called in classic vs kinetic

I believe I’ve seen Kinetic send 2 datasets before–one with a RowMod of empty and one with a RowMod of “U”.

Try adding this:

queryResultDataset.Results.Where(r => r.Calculated_Select && r.RowMod == "U")
1 Like

Previously people complained that Kinetic did NOT send 2 rows :smiling_imp:

1 Like

Shoot, I don’t even know anymore. Everything is just blending together. LOL

3 Likes

As always Hannah! thank you, this fixed it!

1 Like