Thanks for the pointers. I tried Yehuda's suggestion and it made the Insert record function work in my custom code, so I hope it'll be the same for Update & Delete.
Another form API problem I'm having is you used to be able to update a fields data in a current form (for example during an OnAfterValidate event) even if the field wasn't included in the form layout/edit-form by using:
viewBiz.BasicForm.Data["fieldname"] = "newdata";
This doesn't seem to work now.
I assume I should be using:
But there's no documentation on how to use it, only GetDataValue, which I can get to work fine. All I get when I try to use SetDataValue is the EventLog error:
CMS.FormControls.AbstractBasicForm.SetDataValue(string, object)' is inaccessible due to its protection level
I'm not sure why, I'm using it in the same section of code as the GetDataValue which works ok.
Should I be setting form field data, that's not included in the layout/edit-form another way?