Cannot enable on major publishing trigger while adding a workflow to list
-
13-01-2021 - |
Pregunta
My Doc library is major and minor versioning enabled.
I've created SharePoint 2010 workflow for all content types, put there a one single Action "Start Approval(n) process on Current Item with MyUser", changed the Sample5.xoml.wfconfig.xml file with adding:
and in MetaData section:
Manual;#OnNewItem;#OnItemUpdate;#OnMajorCheckIn
But I still cannot check "Start this workflow to approve publishing a major version of an item"
I'm doing all this to create a custom approval workflow but even in simplest form like this main start option is not available for me.
What have I missed?
Solución
Solved with PowerShell. I need to add the workflow first than with PS get it'assosiation ID from WorkflowAssociations lib property than assign this id to DefaultContentApprovalWorkflowId lib property and update the lib. Works.
$web = get-spweb -identity "*Site URL*" $mylib = $web.Lists["*Library Name*"] $wa_guid = ($mylib.WorkflowAssociations | where {$_.Name -like *Workflow unique name*}).Id $mylib.DefaultContentApprovalWorkflowId = $wa_guid $mylib.Update()