I want to retrieve a data row (from the Recorded data table of the form) and load it to the bizform.
I have this code in my web part:
protected override void OnLoad(EventArgs e) { ... QueryMacros macros = new QueryMacros(); macros.Where = String.Format("(UserID = '{0}') AND (UniGridID = '{1}')", CMS.Membership.MembershipContext.AuthenticatedUser.UserID, UniGridID); DataSet dsFilterForm = connection.ExecuteQuery(dataAlterClassinfo.ClassName + ".selectall", null, macros); if (dsFilterForm.Tables[0].Rows.Count != 0 && dsFilterForm.Tables[0].Rows[0][0] != null) { int formRecordId = ValidationHelper.GetInteger(dsFilterForm.Tables[0].Rows[0][0], 0); viewBiz.ItemID = formRecordId; viewBiz.ReloadData(); }
formRecordId loads correct ID which really exists however bizform doesn't update itself and displays this error string: "Form dataItem which is intended to update does not exist."
Do you have the classname set on the bizform(viewbiz)?
What do you mean by classname? I didn't seem to find property classname under the BizForm class. I only found FormName which is correct.
FormName is "Filter Form" however I'm using an alternative form under this one which is called "Filter_SZ". Do you think it has something to do with this? That kentico tries to update "Filter Form" instead of "Filter_SZ"?
Please, sign in to be able to submit a new answer.