Geeks With Blogs

News

Steve Clements .Net and then some....

Took me a little while to figure this one out, you’ve assigned your workflow to a library and you can set all other other flags like “AllowStartChange” and “AllowStartCreate”, but cant see how to set “Start this workflow to approve publishing a major version of an item.”

That’s because its a property on the library itself called “DefaultContentApprovalWorkflowId”

 

So you might want to do something like this…where you have the WorkFlow Association object ($wfAssociation) and the list/library ($list).

$wfAssociation = [Microsoft.SharePoint.Workflow.SPWorkflowAssociation]
::CreateListAssociation(……
$list.WorkflowAssociations.Add($wfAssociation) | Out-Null
$list.DefaultContentApprovalWorkflowId = $wfAssociation.Id
$list.Update()

Resources:

This is probably the best Associate workflow to list/library with Powershell example out there http://bit.ly/AcOa2s

Posted on Tuesday, March 6, 2012 11:52 AM Sharepoint | Back to top


Comments on this post: SharePoint 2010 set ‘Start this workflow to approve publishing a major version of an item’ with Powershell

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Steve Clements | Powered by: GeeksWithBlogs.net