IssueReturn on DLL

I try to do some MTL-STK.
I use tracing on Material Consumption and use all method named on it but i got no error but no transaction.
I use all this method
GetNewJobAsmblMultiple
OnChangingJobSeq
OnChangeToJobSeq
OnChangingFromBinNum
OnChangeFromWarehouse
OnChangingFromBinNum
OnChangeFromBinNum
OnChangeLotNum
OnChangeTranQty
OnChangeToWarehouse
PrePerformMaterialMovement
MasterInventoryBinTests
PerformMaterialMovement

Can some one help me please !

I assume you are setting the proper fields before calling the helpers? Some of the helpers you can pass the data you are changing, others require you set fields manually first (check the signatures).

Also, most of those helpers probably require row mod of U or A to be set.

Check for the output messages for clues from PrePerform, BinTest, and PerformMtlMovement

Where can I see the signature ?
I already check the output of all of this method and the only one returning something is PrePerform and he’s returning False.

You can use a decompiler like DotPeek or Reflector. Look at these out strings


For master Inventory it’s return nothing and RequiresUserInput Return False then I think everything ok, but when I check in the partTranPk is empty. This is my code

and in the file i write in it’s return this :
2019-04-10 13:45:23:89: 3:False
2019-04-10 13:45:23:90: 4: : : : : :
2019-04-10 13:45:23:92: 4.1: :

Can you please post the entire function so we can help (as code) not as a picture.
Also how is this being called? Customization? BPM? External Process?

                internal void DoStructConsuption(out object tranPK, string pPartNum, string pDimCode, string JobNum, int AssemblySeq, int MtlSeq)
        {
            

            tranPK = "";
            
            var ud06 = Db.UD06.Where(r => r.CheckBox01 == true && r.Key3 == JobNum && r.Key1 == pPartNum &&
                                            r.Key4 == AssemblySeq.ToString() && r.Key5 == MtlSeq.ToString());

                    foreach (var rows in ud06.ToList())
                {
                
                    var PartBinRow = Db.PartBin.FirstOrDefault(row => row.Company == Session.CompanyID &&
                                                                      row.PartNum == pPartNum &&
                                                                      row.LotNum == rows.Key2 &&
                                                                      row.DimCode == pDimCode && 
                                                                      row.BinNum == rows.Character01);
                
                    if (PartBinRow == null) { return; } 

                    string partTranPK = "";
                    string mess;
                    
                bool trans=false;
                var fromWrehse = Db.WhseBin.FirstOrDefault(r => r.Company == Session.CompanyID && r.BinNum == rows.Character01);
                var toWrehse = Db.WhseBin.FirstOrDefault(r => r.Company == Session.CompanyID && r.BinNum == rows.Character02);
                string typeAvail="";
                string callProcess = "IssueMaterial";
                string s1 = "";
                string s2 = "";
                string s3 = "";
                string s4 = "";
                string s5 = "";
                string s6 = "";
                var jobassmbl = Db.JobAsmbl.Where(r => r.JobNum == JobNum && r.AssemblySeq == AssemblySeq && r.Company == Session.CompanyID);
                using (var hIssue = Ice.Assemblies.ServiceRenderer.GetService<Contracts.IssueReturnSvcContract>(Db))
                {
                    SelectedJobAsmblTableset selds = new SelectedJobAsmblTableset();
                    SelectedJobAsmblRow selrow = new SelectedJobAsmblRow();
                    selrow.Company = Session.CompanyID;
                    selrow.JobNum = JobNum;
                    selrow.AssemblySeq = AssemblySeq;
                    selrow.Added();
                    selrow.RowMod = "A";
                    selds.SelectedJobAsmbl.Add(selrow);

                    IssueReturnTableset issueTS = hIssue.GetNewJobAsmblMultiple("STK-MTL", Guid.NewGuid(), callProcess, ref selds, out mess);
                    //hIssue.GetNewIssueReturnToJob(JobNum, AssemblySeq, "STK-MTL", Guid.NewGuid(), out mess, ref issueTS);
                    //IssueReturnTableset issueTS = hIssue.;
                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 1.1:" + mess);
                    }
                    issueTS.IssueReturn[0].RowMod = "U";
                    
                    issueTS.IssueReturn[0].PartNum = rows.Key1;
                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 2.1:" + issueTS.IssueReturn[0].PartNum + ": " + mess);
                    }
                    hIssue.GetAvailTranDocTypes(out typeAvail);

                    issueTS.IssueReturn[0].ToJobSeq = MtlSeq;
                    hIssue.OnChangingJobSeq(MtlSeq, "From", callProcess, ref issueTS);
                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 2.2:" + issueTS.IssueReturn[0].ToJobNum + ": " + mess+ " : "+issueTS.IssueReturn[0].ToAssemblySeq+" : "+ typeAvail);
                    }
                    hIssue.OnChangeToJobSeq(ref issueTS,callProcess, out mess);
                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 2.3:"+ issueTS.IssueReturn[0].ToWarehouseCode +": "+" : "+ issueTS.IssueReturn[0].FromWarehouseCode+ mess);
                    }
                    hIssue.OnChangingFromBinNum(ref issueTS, out mess);

                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 2.3.1:" +  mess);
                    }

                    issueTS.IssueReturn[0].FromWarehouseCode = fromWrehse.WarehouseCode;
                    hIssue.OnChangeFromWarehouse(ref issueTS, callProcess);

                    hIssue.OnChangingFromBinNum(ref issueTS, out mess);

                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 2.3.2:" + mess);
                    }

                    issueTS.IssueReturn[0].FromBinNum = rows.Character01;
                    hIssue.OnChangeFromBinNum(false, ref issueTS);
                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 2.4:" + issueTS.IssueReturn[0].FromBinNum+ " : "+ issueTS.IssueReturn[0].ToBinNum+ " : "+ issueTS.IssueReturn[0].OnHandQty);
                    }
                    issueTS.IssueReturn[0].LotNum = rows.Key2;
                    issueTS.IssueReturn[0].OnHandQty = PartBinRow.OnhandQty;
                    issueTS.IssueReturn[0].OnHandUM = "PO";
                    hIssue.OnChangeLotNum(rows.Key2, ref issueTS);
                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 2.5:" + issueTS.IssueReturn[0].LotNum);
                    }

                    issueTS.IssueReturn[0].TranQty = rows.Number01;
                    hIssue.OnChangeTranQty(rows.Number01, ref issueTS);
                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 2.6:" + issueTS.IssueReturn[0].TranQty+ " : "+ issueTS.IssueReturn[0].OnHandQty);
                    }


                    if (toWrehse!=null)
                    {
                        issueTS.IssueReturn[0].ToWarehouseCode = toWrehse.WarehouseCode;
                        issueTS.IssueReturn[0].ToBinNum = toWrehse.BinNum;
                        hIssue.OnChangeToWarehouse(ref issueTS, callProcess);
                    }
                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 2.7:" + issueTS.IssueReturn[0].ToBinNum+ " : "+issueTS.IssueReturn[0].ToJobPartNum + " : "+issueTS.IssueReturn[0].ToJobSeqPartNum + " : " + issueTS.IssueReturn[0].ToJobSeq);
                    }


                    issueTS.IssueReturn[0].PartIUM = "PO";
                    issueTS.IssueReturn[0].DimCode = "PO";
                    issueTS.IssueReturn[0].DUM = "PO";
                    issueTS.IssueReturn[0].UM = "PO";
                    hIssue.PrePerformMaterialMovement(ref issueTS,out trans);

                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 3:" + trans);
                    }


                    hIssue.MasterInventoryBinTests(ref issueTS,out s1,out s2, out s3, out s4, out s5, out s6);
                    string legal;
                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 4:" +s1+ " : "+s2 + " : "+s3 + " : "+s4 + " : "+s5 + " : "+s6);
                    }
                    //string pt;
                    hIssue.PerformMaterialMovement(false, ref issueTS,out legal, out partTranPK);
                    using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append)))
                    {
                        MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 4.1:" + partTranPK+" : "+legal);
                    }
                    tranPK = partTranPK;
                    //throw new BLException(partTranPK);

                }
                /*using (var hInventQtyAdj = Ice.Assemblies.ServiceRenderer.GetService<Contracts.InventoryQtyAdjSvcContract>(Db))
                {

                    InventoryQtyAdjTableset inventQtyData = hInventQtyAdj.GetInventoryQtyAdj(pPartNum, pDimCode);
                        var inventQtyAdj = inventQtyData.InventoryQtyAdj.First();

                        inventQtyAdj.WareHseCode = PartBinRow.WarehouseCode;
                        inventQtyAdj.BinNum = PartBinRow.BinNum;
                        inventQtyAdj.LotNum = rows.Key2;
                        inventQtyAdj.AdjustQuantity = -(rows.Number01);
                        inventQtyAdj.ReasonCode = "CONSTRUC";
                        inventQtyAdj.StkUOMCode = pDimCode;

                        inventQtyAdj.RowMod = "U";

                        hInventQtyAdj.SetInventoryQtyAdj(ref inventQtyData, out partTranPK);



                    }*/

                // update AGM QTY
                var partLot = Db.PartLot.FirstOrDefault(row => row.Company == Session.CompanyID && row.LotNum == rows.Key2 && row.PartNum == rows.Key1);
                partLot.AGM_BeginConsumption_c = true;
                partLot.AGM_Quantity_c = partLot.AGM_Quantity_c - Convert.ToInt32(rows.Number01);
                /*if (partTranPK != "")
                {
                    var binObj = Db.PartBin.FirstOrDefault(r => r.Company == Session.CompanyID && r.LotNum == rows.Key2 && r.BinNum == rows.Character01);
                    if (binObj != null)
                    {
                        if(rows.Character02!="" && rows.Character02!= rows.Character01)
                        { InventoryTransfer(binObj.BinNum, rows.Character02, pPartNum, rows.Key2, binObj.OnhandQty, out tranPK); }
                        
                    }
                    ChangeReservation(JobNum, AssemblySeq, MtlSeq, rows.Number01);
                }*/
            }
        }

        private void ChangeReservation(string JobNum, int AssemblySeq, int MtlSeq, decimal Qty)
        {
            /*var JobMtlRow = Db.JobMtl.FirstOrDefault(row => row.Company == Session.CompanyID &&
                                                row.JobNum == JobNum &&
                                                row.AssemblySeq == AssemblySeq &&
                                                row.RelatedOperation == OprSeq);*/

            //if (JobMtlRow == null) { return; }

            var UD06Rows = Db.UD06.Where(row => row.Company == Session.CompanyID &&
                                                  row.Key3 == JobNum &&
                                                  row.Key4 == AssemblySeq.ToString() &&
                                                  row.Key5 == MtlSeq.ToString()) ;
            foreach (var UD06Row in UD06Rows.ToList())
            { Db.UD06.DeleteObject(UD06Row); }
               
                 
          


        }

        public void uomBuyUnit(out object convUOM,string uom)
        {
            var uomRow=Db.UOM.FirstOrDefault(r => r.Company == Session.CompanyID && r.UOMCode == uom);
            convUOM = 0;
            if (uomRow == null) { convUOM = -1; return; }
            if ((bool)uomRow.AGM_UnitBuying_c)
               {
                   var uomConvRow=Db.UOMConv.FirstOrDefault(r => r.Company == Session.CompanyID &&
                                                    r.UOMClassID == "Structurel" &&
                                                    r.UOMCode == uom);
               if (uomConvRow!=null)
                {
                    convUOM = uomConvRow.ConvFactor;
                }
               }


        }
        public void delParentRcvDtl (int PONum, int VendorNum, string PurPoint, string PackSlip, int PackLine, int POLine, int PORelNum)
        {
            var rcvDtlRow =Db.RcvDtl.FirstOrDefault(r => r.PONum == PONum && r.VendorNum == VendorNum &&
                                r.PurPoint==PurPoint && r.PackSlip == PackSlip &&
                                r.PackLine == PackLine && r.POLine == POLine && r.PORelNum == PORelNum);
            if (rcvDtlRow!=null)
            {
                if (rcvDtlRow.Received == true)
                {
                    var lot = Db.PartLot.FirstOrDefault(r => r.LotNum == rcvDtlRow.LotNum && r.Company == Session.CompanyID);
                    if(lot!=null)
                    { Db.PartLot.DeleteObject(lot); }
                }
                Db.DeleteObject(rcvDtlRow);
            }

        }

        public void GetCompleteQty(out object qty, string jobNum, string assmblSeq, string mtlSeq)
        {
            decimal qtyComp=0;
            
            var rowsUD = Db.UD06.Where(row => row.Key3 == jobNum && row.Key4 == assmblSeq && row.Key5 == mtlSeq);
            
            foreach (var UD in rowsUD)
            {
                qtyComp += UD.Number03;
            }
            qty = qtyComp.ToString();

        }
        /*public void GetScrapQty(out object qty, string jobNum, string assmblSeq, string mtlSeq)
        {
            decimal qtyComp = 0;

            var rowsUD = Db.UD06.Where(row => row.Key3 == jobNum && row.Key4 == assmblSeq && row.Key5 == mtlSeq);

            foreach (var UD in rowsUD)
            {
                qtyComp += UD.Number04;
            }
            qty = qtyComp.ToString();

        }*/
        private void InventoryTransfer(string fromBinNum, string toBinNum, string partNum, string lotNum, decimal qty, out string partTran)
        {
            var toBinObj = Db.WhseBin.FirstOrDefault(r => r.Company == Session.CompanyID && r.BinNum == toBinNum);
            var fromBinObj = Db.WhseBin.FirstOrDefault(r => r.Company == Session.CompanyID && r.BinNum == fromBinNum);
            var lotObj = Db.PartLot.FirstOrDefault(r => r.Company == Session.CompanyID && r.LotNum == lotNum && r.PartNum == partNum);
            bool requiredUserInput = false; 
            string legalNumberMsg = "";
            string uom = lotObj.AGM_UOM_c;
            string partTranPk = "";
            partTran = "";
            string warehouseCode = toBinObj.WarehouseCode;
            string binNum = toBinObj.BinNum;

            warehouseCode = fromBinObj.WarehouseCode;
            binNum = fromBinObj.BinNum;

            var invTransferTableset = new InvTransferTableset();
            using (var invTransferSvc = Ice.Assemblies.ServiceRenderer.GetService<Contracts.InvTransferSvcContract>(Db))
            {
                invTransferTableset = invTransferSvc.GetTransferRecord(partNum, string.Empty);
                var ttInvTranRow = invTransferTableset.InvTrans.FirstOrDefault();
                if (ttInvTranRow == null)
                {
                    throw new BLException("Error on Transfert");
                }

                ttInvTranRow.RowMod = IceRow.ROWSTATE_UPDATED;

                ttInvTranRow.TransferQty = qty;
                invTransferSvc.ChangeUOM(ref invTransferTableset);

                ttInvTranRow.TransferQtyUOM = uom;
                invTransferSvc.ChangeUOM(ref invTransferTableset);

                if (ttInvTranRow.FromWarehouseCode != fromBinObj.WarehouseCode)
                {
                    ttInvTranRow.FromWarehouseCode = warehouseCode;
                    invTransferSvc.ChangeFromWhse(ref invTransferTableset);
                }

                ttInvTranRow.FromLotNumber = lotNum;
                ttInvTranRow.ToLotNumber = lotNum;
                //invTransferSvc.ChangeLot(ref invTransferTableset);

                ttInvTranRow.FromBinNum = fromBinObj.BinNum;
                invTransferSvc.ChangeFromBin(ref invTransferTableset);

                if (ttInvTranRow.ToWarehouseCode != toBinObj.WarehouseCode)
                {
                    ttInvTranRow.ToWarehouseCode = toBinObj.WarehouseCode;
                    invTransferSvc.ChangeToWhse(ref invTransferTableset);
                }

                ttInvTranRow.ToBinNum = toBinObj.BinNum;
                invTransferSvc.ChangeToBin(ref invTransferTableset);

                //ttInvTranRow.TranReference = Erp.BO.AGM_Batch.Resources.Strings.SplitRemnantReference(toRow.BatchID);

                invTransferSvc.PreCommitTransfer(ref invTransferTableset, out requiredUserInput);
                invTransferSvc.CommitTransfer(ref invTransferTableset, out legalNumberMsg, out partTranPk);
                partTran = partTranPk;
            }
            // Libérer la table PartBinDeferred
            if (_libDeferredUpdate == null)
            {
                _libDeferredUpdate = new DeferredUpdate(Db);
            }
            _libDeferredUpdate.UpdPQDemand();
        }
        public void getBoolRelComplete (int PONum, int POLine, int PORel, out object valid)
        {
            valid = 0;
            var RowRcvDtl = Db.RcvDtl.Where(row => row.PONum == PONum && row.POLine == POLine && row.PORelNum == PORel);
            var RowPORel = Db.PORel.FirstOrDefault(r => r.PONum == PONum && r.POLine == POLine && r.PORelNum == PORel);
            if (RowPORel.ReceivedQty >= RowPORel.RelQty)
            {
                valid = 1;

            }

          }    

and the file I write in is :

2019-04-10 13:45:23:02: 1.1:
2019-04-10 13:45:23:02: 2.1:ST-0000405:
2019-04-10 13:45:23:13: 2.2:1268253: : 0 :
2019-04-10 13:45:23:86: 2.3:1PROD: : 1PRIN
2019-04-10 13:45:23:86: 2.3.1:
2019-04-10 13:45:23:88: 2.3.2:
2019-04-10 13:45:23:88: 2.4:100613 : 100538 : 0
2019-04-10 13:45:23:89: 2.5:130035-04-01-004
2019-04-10 13:45:23:89: 2.6:2.00000000 : 134.00000000
2019-04-10 13:45:23:89: 2.7:100538 : 002530-02 : ST-0000405 : 50
2019-04-10 13:45:23:89: 3:False
2019-04-10 13:45:23:90: 4: : : : : :
2019-04-10 13:45:23:92: 4.1: :

And it’s on a DLL i write in

A DLL called from where? a BPM by the looks of it? I see you are using DB Context./

Nope i call this function by an Adapter in a Customization

I do this is a customized dashboard to Return Material. What I found was you needed to create a new Issue Return Row and then add it to the dataset. I use WCF
Web Services versus Adapters but the concept should be the same. I could nto find a way to have a new row populate with default values so I had to set them myself. Here is a snippet of my code, variables declared and populated prior to reaching this point

using(var issueReturnImpl = WCFServiceSupport.CreateImpl(_session, IssueReturnImpl.UriPath))

{

//** NEW ISSUE RETURN ROW

var issueReturnDs = new IssueReturnDataSet();

var newRow = issueReturnDs.IssueReturn.NewIssueReturnRow();

//** SET VALUES

newRow.Company = “APMC”;

newRow.TranDate = DateTime.Today;

newRow.FromJobNum = job;

newRow.FromAssemblySeq = asm;

newRow.FromJobPartNum = jobPart;

newRow.FromAssemblyPartNum = jobPart;

newRow.FromJobSeqPartNum = mtlPart;

newRow.FromJobPartDesc = jobPartDesc;

newRow.FromAssemblyPartDesc = asmPartDesc;

newRow.FromJobPartDescription = jobPartDesc;

newRow.TranType = “MTL-STK”;

newRow.DimConvFactor = 1;

newRow.FromJobPlant = “MfgSys”;

newRow.ToJobPlant = “MfgSys”;

newRow.DummyKeyField = string.Empty;

newRow.TreeDisplay = job + " : " + asm.ToString();

newRow.ProcessID = “ReturnMaterial”;

newRow.Plant = “MfgSys”;

newRow.TranReference = “Returned by Material Processing Queue”;

//Default Values

newRow.PartNum = string.Empty;

newRow.TranQty = 0;

newRow.FromJobSeq = 0;

newRow.DimCode = string.Empty;

newRow.ReasonCode = string.Empty;

newRow.OrderNum = 0;

newRow.OrderLine = 0;

newRow.OrderRel = 0;

newRow.FromWarehouseCode = string.Empty;

newRow.FromBinNum = string.Empty;

newRow.FromJobSeqPartDesc = string.Empty;

newRow.OnHandQty = 0;

newRow.QtyRequired = 0;

newRow.QtyPreviouslyIssued = 0;

newRow.IssuedComplete = false;

newRow.ToJobNum = string.Empty;

newRow.ToAssemblySeq =0;

newRow.ToJobSeq = 0;

newRow.ToWarehouseCode = string.Empty;

newRow.ToBinNum = string.Empty;

newRow.ToJobPartNum = string.Empty;

newRow.ToAssemblyPartNum = string.Empty;

newRow.ToJobSeqPartNum = string.Empty;

newRow.ToJobPartDesc = string.Empty;

newRow.ToAssemblyPartDesc = string.Empty;

newRow.ToJobSeqPartDesc = string.Empty;

newRow.ReasonType = string.Empty;

newRow.FromAssemblyPartDescription = string.Empty;

newRow.FromJobSeqPartDescription = string.Empty;

newRow.ToJobPartDescription = string.Empty;

newRow.ToAssemblyPartDescription = string.Empty;

newRow.ToJobSeqPartDescription = string.Empty;

newRow.SerialNoQty = 0;

newRow.MtlQueueRowId = Guid.Empty;;

newRow.InvAdjReason = string.Empty;

newRow.DUM = string.Empty;

newRow.UM = string.Empty;

newRow.EnableToFields = true;

newRow.EnableFromFields = false;

newRow.RequirementUOM = string.Empty;

newRow.RequirementQty = 0;

newRow.EnableSN = false;

newRow.SerialControlPlant = string.Empty;

newRow.SerialControlPlantIsFromPlt = false;

newRow.SerialControlPlant2 = string.Empty;

newRow.TrackDimension = false;

newRow.OnHandUM = string.Empty;

newRow.TranDocTypeID = string.Empty;

newRow.TFOrdNum = string.Empty;

newRow.TFOrdLine = 0;

newRow.ReassignSNAsm = false;

newRow.ReplenishDecreased = false;

newRow.EnablePCID = false;

newRow.EnablePCIDGen = false;

newRow.EnablePCIDPrint = false;

newRow.PkgControlID = string.Empty;

newRow.FromPCID = string.Empty;

newRow.ToPCID = string.Empty;

newRow.ToPCIDItemSeq = 0;

newRow.FromPCIDItemSeq = 0;

newRow.DimCodeDimCodeDescription = string.Empty;

newRow.FromBinNumDescription = string.Empty;

newRow.FromWarehouseCodeDescription = string.Empty;

newRow.LotNumPartLotDescription = string.Empty;

newRow.PartTrackLots = false;

newRow.PartTrackSerialNum = false;

newRow.PartTrackDimension = false;

newRow.PartSalesUM = string.Empty;

newRow.PartIUM = string.Empty;

newRow.PartPricePerCode = “E”;

newRow.PartSellingFactor = 1;

newRow.PartPartDescription = string.Empty;

newRow.ReasonCodeDescription = string.Empty;

newRow.ToBinNumDescription = string.Empty;

newRow.ToWarehouseCodeDescription = string.Empty;

newRow.RowMod = string.Empty;

//**ADD ROW TO TABLE

issueReturnDs.IssueReturn.AddIssueReturnRow(newRow);

issueReturnImpl.OnChangingJobSeq(mtlSeq, “From”, “ReturnMaterial”, issueReturnDs);

var pcMessage = string.Empty;

issueReturnImpl.OnChangeFromJobSeq(issueReturnDs, “ReturnMaterial”, out pcMessage);

var tranQty = (decimal)row.GetCellValue(“PartTran_TranQty”);

issueReturnImpl.OnChangeTranQty(tranQty, issueReturnDs);

var legalNumberMessage = string.Empty;

var partTranPKs = string.Empty;

issueReturnDs.IssueReturn[0].LotNum = lotNum;

issueReturnImpl.PerformMaterialMovement(false, issueReturnDs, out legalNumberMessage, out partTranPKs);

}

Scott

:scream: then why / how are you using Db Context? If you are calling it from a Customization you should be using the adapter to make the transaction you are running server side code on the client… This is really not best practice lots of potential issues.
Any particular reason why you aren’t using the adapter?

Looked at all your code it seems fine, my guess is that you are missing a RowMod somehwere, however that’s hard to tell. Can you replicate your code in BL Entry without issue?

Also as a pointer, this calls

   using(var MyFile = new System.IO.StreamWriter(new System.IO.FileStream("c:\\temp\\testDLL.txt", System.IO.FileMode.Append))) {
     MyFile.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ff") + ": 1.1:" + mess);
    }

are REALLY expensive you are opening the file writing something and closing the file IO operations are quite pricey specially opening / closing. I recommend you open the file once (for append) and close it once at the end it will save you a ton of time

2 Likes

Probably you dont want to do this. It should be “A” and is set by the GetNew…

This on an Adapter I create so i use my DB Context to get my information, not upate him. I call this adapter in a Customization. So this is a Server Side code.
For Chris_Conn I try at first the RowMod = “A”, but nothing happen

Are you talking about a new custom adapter you created using the SDK? Sorry I’m trying to understand so we can better help you :slight_smile:

Unrelated, but wouldnt you want this to continue, not return?

So is hIssue an adapter or BO? If it is an adapter, it returns a bool not a tableset.

(EDIT - NM i see it instanciated as a BO)

I am curious what version this is. I am decomping 10.1.600 and in the call above, I dont see the parameter selds referenced.

For the first message i will change it. I was using code of other one and didnt expect that could do some trouble, but for now it is not my problem because he continue to the fonction. But it not suppose to get problem because i got a BPM that change my UD06 BinNum if we have change it.
For the version we use:
10.2.200

Someone can say what is the difference between Guid.NewGuid() and Guid.Empty and which one I need to use in this case ?

Thank you.
So i need an Empty one