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