Thanks Boris, that's working now.
I have since come across two other issues with Forms which I though I would share.
The first was this one:[BasicForm.DataRow]: This property can be read only if it was previously initialized through set.
This exception was raised when running the following code in the OnBeforeSave event handler:
string FirstName = CMS.GlobalHelper.ValidationHelper.GetString(this.viewBiz.BasicForm.DataRow["FirstName"], "");
I was advised that the BasicForm.DataRow
property has been replaced with the BasicForm.Data
so I would need to use IDataContainer row = this.viewBiz.BasicForm.Data;
instead ofDataRow row = this.viewBiz.BasicForm.DataRow;
With this in mind, the offending code was rewritten as follows:
IDataContainer row = this.viewBiz.BasicForm.Data;
string FirstName = ValidationHelper.GetString(row["FirstName"], String.Empty);
You'll need to add a using CMS.SettingsProvider;
to your code file in order to resolve IDataContainer.
The next issue was that the DataClass object no longer existed, but the updated code can be found in this post