treeNode.Update() doesnt trigger a staging task

Laura Frese asked on February 6, 2021 21:11

When creating and updating a page programmatically it doesnt trigger a staging task. I am creating the page via the API and then adding a page relationship and categories/category. When I synch the task from stage to production, it doesnt include the categories or page relationships. How do I include these in staging?

Correct Answer

Laura Frese answered on February 6, 2021 21:16

DocumentSynchronizationHelper.LogDocumentChange(TreeNode node, TaskTypeEnum taskType, TreeProvider tree) after the newPage.Update() or newPage.Publish() will include it in staging. For taskType, use TaskTypeEnum.CreateDocument, TaskTypeEnum.UpdateDocument, or MoveDocument or PublishDocument or other suitable task type according to the performed task. newPage.CheckOut() and newPage.CheckIn() may also have to be used

2 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.