Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Publish Documents From Code behind View modes: 
User avatar
Member
Member
TonyG - 7/25/2012 4:42:40 PM
   
Publish Documents From Code behind
When creating a new document via the code behind like (http://devnet.kentico.com/docs/devguide/index.html?documents_api_examples_creating_documents.htm, second example)

How can I automatically publish the document.

I tried
VersionManager vm = new VersionManager(tree);
vm.PublishVersion(newNode.DocumentCheckedOutVersionHistoryID);


With no success.

User avatar
Member
Member
TonyG - 7/26/2012 7:46:30 AM
   
RE:Publish Documents From Code behind
Figured it out here is the answer in case any was wondering:

                        WorkflowManager workflowManager = new WorkflowManager(tree);

workflowManager.MoveToNextStep(newNode, null);

User avatar
Kentico Support
Kentico Support
kentico_radekm2 - 7/30/2012 1:08:20 AM
   
RE:Publish Documents From Code behind
Hello.

Thank you for sharing this solution with others.

Please note, there is a complete API example for managing documents under workflow, which can be found here.

Best Regards,
Radek Macalik