I'm attempting to add a child node to an existing node using:
newPage.Insert(parentPage); newPage.Publish();
This results in a "The node MYNODENAME does not support workflow" error.
the node is a content-only page type.
Have you applied a workflow to the parent item and its children? If you don't plan to, comment out the publish action and the error should not happen.
EDIT:
See this documentation to learn how to insert pages in different scenarios, like under workflow, versioning without workflow, etc.
Hi Dat, If I apply workflow to the parent and then programmatically add a node will workflow automatically be applied to the new item? Thanks!
It should.
Programmatically, you can check if a page is under workflow, and if so, publish the page, like so:
if (newPage.WorkflowStep != null) { newPage.Publish(); }
Please, sign in to be able to submit a new answer.