"Form dataItem which is intended to update does not exist."

Jaroslav Šebok asked on September 13, 2016 15:47

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."

Recent Answers


Joshua Adams answered on September 13, 2016 17:53

Do you have the classname set on the bizform(viewbiz)?

0 votesVote for this answer Mark as a Correct answer

Jaroslav Šebok answered on September 14, 2016 09:12

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.

0 votesVote for this answer Mark as a Correct answer

Jaroslav Šebok answered on September 14, 2016 09:17

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"?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.