Hello, I am creating a customer shipment, from the api rest, but when selecting the series of a part, I did not find how to create a new record in the tableset, previously it was:
foreach (SelectedSerialNumbersDataSet.SelectedSerialNumbersRow drr in ssds.SelectedSerialNumbers.Rows)
{
if (drr.SerialNumber == Series)
{
drr.RowMod = “A”;
csds.SelectedSerialNumbers.Rows.Add (drr.ItemArray);
}
}
I try with the tableset in the following way, without obtaining positive results
You still didnt tell me what your error was, if I had to guess, it’s complaining when you try to add that row.
cs.SelectedSerialNumbers.NewRow (); has no effect other than adding a blank row, generally, you would assign that to a var to work on the actual row it creates like:
var newrow = cs.SelectedSerialNumbers.NewRow ();
newrow[“MyField”] = myValue;
In your case, it seems you are trying to add a row from a different table. Assuming they are identical types (cause this wont work otherwise), you will need to use cs.SelectedSerialNumbers.ImportRow(drr); Also, the NewRow() as mentioned earlier is not needed.
Never mind, I figured it out by finding it in another post. So much for trying a quick and easy solution from anyone else who knows more than I do, which is most of the people on this site. See below:
var newsrl = arb.APSelectedRcptLines.NewRow();
newsrl[“Company”] = arb.APUninvoicedReceipts[0].Company;
newsrl[“RodMod”] = “A”;
arb.APSelectedRcptLines.Add(newsrl);
this.PublishInfoMessage(arb.APSelectedRcptLines[0].Company,Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual,"","");
Thanks,
Richard