I’m trying to insert a new row into UD01 from a customization through the UD01 adapter.
I just want to pass a User ID into Key1 and a Class ID into Key 2. I’ve had luck updating existing UD rows through the adapter, but I can’t figure out how to insert a new row.
I’ve searched, snipped, tested, traced, and explored objects fruitlessly, and I’m at the point where I’m just going to ask to see if I’m anywhere near the right track. This is the closest I’ve gotten:
//Process this User and Part Class
UD01Adapter adapterUD01 = new UD01Adapter(oTrans);
adapterUD01.BOConnect();
DataRow dr = adapterUD01.UD01Data.UD01.Rows.Add();
dr.BeginEdit();
dr["Company"] = "NOS";
dr["Key1"] = thisUserID;
dr["Key2"] = thisClassID;
dr["Key3"] = "";
dr["Key4"] = "";
dr["Key5"] = "";
dr.EndEdit();
adapterUD01.Update();
adapterUD01.Dispose();
This code compiles successfully, but when executed, I’m given the error “Column ‘Company’ does not allow nulls.”
Am I anywhere close to the mark here? Or is there another way to build the row for inserting into UD01?