I need some help to add new documents using the new Kentico document API http://devnet.kentico.com/articles/kentico-8-technology-documentquery-api . In the previous version Kentico 7, TreeNode.Insert(2 methods) use to work but in the new version it has been deprecated. What is the replacement function?
This is my code snippet:
if (parent != null) { node.NodeName = "MyFirstNews"; node.NodeAlias = "MyFirstNews"; node.SetValue("DocumentCulture", "en-us"); node.SetValue("NewsTitle", "MyFirstNewsTitle"); node.SetValue("NewsSummary", "My First News Summary."); node.SetValue("NewsText", "My First News Text."); node.SetValue("NewsReleaseDate", DateTime.Now); //To insert the document node.Insert(parent.NodeID); return true; }
I am also experiencing this problem. Does the functionality to add documents using the API exist?
I use it often. What do you mean deprecated?
It doesn't show as deprecated on my machine using Kentico 8.1.
What is deprecated is new TreeNode() which is replaced with TreeNode.New().
new TreeNode()
TreeNode.New()
No I don't think that is reference in the code snippet. The section that is deprecated in version 8 is: //To insert the document node.Insert(parent.NodeID); The question is how do you create a new document in Kentico version 8 from code or using the document API if possible?
You might also check out the API Changes from 7 -> 8
Please, sign in to be able to submit a new answer.