Hello,
I created new Custom Table: "NewsDepartment" then I created an Alternative form for this custom table "InsertDep" for insert NewsDepartment. then I created a modoul and added it's folder under "CMSModules" folder like I should do.
then I added a user control and added a CMS:CustomTableForm to that user control like this:
<asp:Content ID="cntBody" runat="server" ContentPlaceHolderID="plcContent">
<cms:CustomTableForm id="tblform" runat="server" />
</asp:Content>
and in Code behind:
protected override void OnInit(EventArgs e)
{
tblform.ShowPrivateFields = true;
tblform.CustomTableId = CMS.SettingsProvider.DataClassInfoProvider.GetDataClass("customtable.NewsDepartment").ClassID;
tblform.FormMode = CMS.FormEngine.FormModeEnum.Insert;
tblform.AlternativeFormFullName = "customtable.NewsDepartment.InsertDep";
tblform.ItemID = 3;
}
when I run project and want to work with that modul I get this error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Custom table record which is intended to update does not exist.
I already checked CMS_Class table and the record for my Custom table is there and when i put break point in this line:
tblform.CustomTableId = CMS.SettingsProvider.DataClassInfoProvider.GetDataClass("customtable.NewsDepartment").ClassID;
it returns CustomTableId properly. so what is the Problem?
Thank you.