Sitecore: Assign workflow to an item programmatically

后端 未结 4 1691
深忆病人
深忆病人 2020-12-17 04:24

I have configured a workflow, starts with \"Draft\" state as usual. And I have configured the workflow for standard values of the template. It works perfect in Content edito

4条回答
  •  不思量自难忘°
    2020-12-17 04:45

    Solved the issue with Standard Fields,

    newItem.Editing.BeginEdit();                    
    newItem.Fields["__Workflow"].Value = "{4D1F00EF-CA5D-4F36-A51E-E77E2BAE4A24}"; //Set workflow
    newItem.Fields["__Workflow state"].Value = "{7F39DF46-B4B9-4D08-A0D4-32DE6FD643D1}"; //Set   workflow state to Unposted.
    newClassified.Editing.EndEdit();  
    

提交回复
热议问题