How to Create a new Inventory Transfer using BPM

Hi, so I have a custom UD Form. this Custom UD Form will be Automated in the Inventory Transfer Process. But I wonder what the BO Method Should I call. I already tried to create the BPM but it always has this error “Non-static method requires a target”. This is my code I’m tried to Hardcode my data first.

foreach(var ud102 in ds.UD102)
{
  try
  {
  using(var invTransSvc = Ice.Assemblies.ServiceRenderer.GetService<InvTransferSvcContract>(Db))
  {
    bool preCommitSuccess = true;
    string legalNumberMessage = "";
    string partTranPks = "";
    InvTransferTableset invTransfer = new InvTransferTableset();
    //invTransSvc.GetTransferRecord(" PTH0006", Guid.NewGuid(), "", "Kg", out preCommitSuccess, ref invTransfer);  
    invTransSvc.GetNewInventoryTransfer("STK-STK",ref invTransfer);
    invTransfer.InvTrans[0].PartNum = " PTH0006";
    invTransfer.InvTrans[0].TransferQty = 1;
    invTransfer.InvTrans[0].TrackingQty = 1;
    invTransfer.InvTrans[0].TranDate = DateTime.Now;
    invTransfer.InvTrans[0].TrackingUOM = "Kg";
    invTransfer.InvTrans[0].FromPlant = "KACS";
    invTransfer.InvTrans[0].Plant = "KACS";
      
    invTransfer.InvTrans[0].Plant2 = "KACS";
    invTransfer.InvTrans[0].ToPlant = "KACS";
    invTransfer.InvTrans[0].TransferQtyUOM = "Kg";
    invTransfer.InvTrans[0].FromWarehouseCode = "LOAD";
    invTransfer.InvTrans[0].ToWarehouseCode = "LOAD";
    invTransfer.InvTrans[0].FromBinNum = "LD01";
    invTransfer.InvTrans[0].ToBinNum = "LD01";
    invTransfer.InvTrans[0].FromLotNumber = ".0131";
    invTransfer.InvTrans[0].ToLotNumber = ".0132";
    invTransSvc.PreCommitTransfer(ref invTransfer, out preCommitSuccess);
    invTransSvc.CommitTransferAndUpdateHistory(ref invTransfer, out legalNumberMessage);
    
  }
  }
  catch(Exception e)
  {
    if(e.InnerException != null)
    {
    
      callContextBpmData.Character01 = e.Message + " Inner : " + e.InnerException.Message; 
    }
    else
    {
       callContextBpmData.Character01 = e.Message;
    }
  }
  
}

There are a lot more methods that are called in that transaction that you are skipping. There’s one for change to bin, change from bin, change part number, change to whse etc.

Do a trace, from when you load the part number, to when you hit the transfer button and make all of the those calls and it can work. (I have done it). Use the business objects to make sure that get it right.

Hi @Banderson, I just know that in the Kinetic version the Trace log is not working. That’s why I don’t get any information from the log. I’m switching to my Classic version and now I get some information from the log

Hi @Banderson, I’m unable to create Inventory Transfer using the Classic menu. Can I get your Log for the Inventory Transfer? or maybe can you tell me the call when we press the Transfer Button. I don’t know why when I tried pressing the Transfer Button it always ran the Kinetic Version. Thanks

Hello,

did you ever find a solution to your problem? If so, would you mind sharing? Thank you

Interesting. I was thinking of making an inventory transfer BPM and this would be a good start. I already have it working in customization so should be able to fit in the missing method calls. There werent that many if I recall - GetTransferRecord, ChangeToWhse, PreCommittTransfer and CommittTransfer for my mass inventory transfer screen

Don’t do it… You will kill yourself with complaints. Revisit your business processes and compare with the way Epicor works before doing any automation.

2 Likes

Well son of a gun I got it to work at least for one part. I was able to transfer from our main warehouse to an expiry warehouse using BO calls from within a function. There were some foibles that I had learned about from using the Inventory transfer adapter. The big learning curve was how to write an Epicor function. I had not even looked at them before.