It looks like in your first example you are using the Document API and the NodeFactory API in the second. NodeFactory only works with published data. So I would assume the children aren't published yet, that should be the only reason you wouldn't see them.
So you can either try using the Document API on your second call, or publish the node after you create it. See this page for more info on the differences and this page for info on publishing a document afer you create it.
Node seems not to have children
Hi,
I create new documents via the umbraco 4.7 API:
Document.MakeNew(name, DocumentType.GetByAlias("News"), User.GetUser(0), 1200)
You can see I set their parent nodeId to 1200. The problems occures when I try to find the children of the node with id 1200:
new Node(1200).Children / new Node(1200).ChildrenAsTable() / new Node(1200).ChildrenAsList
all of the above methods return no children. Can you assume why?
Thanks from advance
Hi Ben,
It looks like in your first example you are using the Document API and the NodeFactory API in the second. NodeFactory only works with published data. So I would assume the children aren't published yet, that should be the only reason you wouldn't see them.
So you can either try using the Document API on your second call, or publish the node after you create it. See this page for more info on the differences and this page for info on publishing a document afer you create it.
Hope this helps,
Tom
Hi,
I did use the Document.Publish method but I didn't know about the umbraco.library.UpdateDocumentCache.
Now I use it and it works fine. THANKS!
is working on a reply...