GetaNewUDxx (multiple records in transaction)

Ok sleep helped. I’ve got it working. The gist of the problem is that when you manually create a row, it doesn’t initialize (things like fields that cant be null,company, sysrow etc).

You can manually create rows but you have to populate EVERYTHING - usually when using GetaNewUD39 it populates most of the mundane. BTW - You can use the typed fields of the (row) - I just haven’t went back to reformat it. I.E. row.Company = “CP”;

for (int record = 0; record < howmany; record++)
            {
                    var row = a.UD39Data.UD39.NewUD39Row();
                    row.BeginEdit();

                    //init the damn thing...... You better do all of this OR ELSE
                    for (int x = 1; x <= 20; x++)
                    {
                        row["CheckBox" + x.ToString("d2")] = false;
                        row["Number" + x.ToString("d2")] = 0;
                        row["ShortChar" + x.ToString("d2")] = "";
                        if(x<11) row["Character" + x.ToString("d2")] = "";
                        row["Date" + x.ToString("d2")] = DBNull.Value;
                       
                    }

//other required fields you MUST fill
                    row["Company"] = company;
                    row["RowMod"] = "A";
                    row["BitFlag"] = false;
                    row["GlobalUD39"] = false;
                    row["GlobalLock"] = false;
                    row["SysRowID"] = new Guid();
                    row["SysRevID"] = 0;

//the rest of your actual data here
                    
                    row.EndEdit();
                    a.UD39Data.UD39.AddUD39Row(row);
    
            }
     a.Update();
            
         ```