Kentico 页面更新不更新物理 table
Kentico page update not update Physical table
我有 Kentico 网站,该网站具有与外部数据库同步数据的调度程序任务。基本上很少有从外部数据库创建的页面 table。我们在 Kentico table.
中有两种创建和更新记录的方法
对于创建我们使用
TreeNode page = TreeNode.New(Helper.ClassName_Campus);
page.SetValue("Title", "Title");
page.Insert(parentPage);
创建记录工作正常并更新物理 table 数据。
我们使用
进行更新
TreeNode page = DocumentHelper.GetDocuments(Helper.ClassName_Campus).OnSite("site").Where(" ID", QueryOperator.Equals, 1).FirstObject;
page.SetValue("Title", "Title");
page.Update();
更新方法确实有效。当我转到页面和表单数据时,我可以在表单字段上看到新数据,但它不会更新实际的物理 table 数据。我们如何在更新页面时更新实际的物理数据table。更新后 Kentico 在哪里存储表单数据。
这是我们在 kentico 网站上找到的 link 更新 table 数据。
https://docs.kentico.com/display/K9/Working+with+pages+in+the+API
您是否为此页面使用了工作流程?
您可以尝试使用 DocumentHelper.UpdateDocument(...) 并在那里指定一个 TreeProvider,因为您可能没有更新此页面的权限。
Kentico 内容 table(绑定到页面类型的内容)始终包含[=15=]仅已发布的 数据。如果您使用 workflow/versioning,则 "new" 数据将存储在 CMS_VersionHistory table 中。
解决方案就是使用类似以下内容发布页面:
var page = DocumentHelper.GetDocument(1, new TreeProvider());
page.DocumentName = "Update name";
page.Publish();
我有 Kentico 网站,该网站具有与外部数据库同步数据的调度程序任务。基本上很少有从外部数据库创建的页面 table。我们在 Kentico table.
中有两种创建和更新记录的方法对于创建我们使用
TreeNode page = TreeNode.New(Helper.ClassName_Campus);
page.SetValue("Title", "Title");
page.Insert(parentPage);
创建记录工作正常并更新物理 table 数据。
我们使用
进行更新 TreeNode page = DocumentHelper.GetDocuments(Helper.ClassName_Campus).OnSite("site").Where(" ID", QueryOperator.Equals, 1).FirstObject;
page.SetValue("Title", "Title");
page.Update();
更新方法确实有效。当我转到页面和表单数据时,我可以在表单字段上看到新数据,但它不会更新实际的物理 table 数据。我们如何在更新页面时更新实际的物理数据table。更新后 Kentico 在哪里存储表单数据。
这是我们在 kentico 网站上找到的 link 更新 table 数据。 https://docs.kentico.com/display/K9/Working+with+pages+in+the+API
您是否为此页面使用了工作流程?
您可以尝试使用 DocumentHelper.UpdateDocument(...) 并在那里指定一个 TreeProvider,因为您可能没有更新此页面的权限。
Kentico 内容 table(绑定到页面类型的内容)始终包含[=15=]仅已发布的 数据。如果您使用 workflow/versioning,则 "new" 数据将存储在 CMS_VersionHistory table 中。
解决方案就是使用类似以下内容发布页面:
var page = DocumentHelper.GetDocument(1, new TreeProvider());
page.DocumentName = "Update name";
page.Publish();