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;
}
}
}