1

How can i uncheck the option/setting "Start this workflow to approve publishing a major version of an item" in a publishing approval workflow of a pages library of publishing site.

I found other settings like Association.AutoStartChange=true; and Association.AutoStartCreate=true; but i am unable to uncheck this option through programatically.

Any idea ?

Thanks Purna

2

You need to get the association ID of the workflow and set following property to set it programmatically.

SPList.DefaultContentApprovalWorkflowId

1

check this out:

WorkflowContext.AllowDefaultContentApproval

http://msdn.microsoft.com/en-gb/library/microsoft.sharepoint.workflowactions.workflowcontext.allowdefaultcontentapproval.aspx

SPWorkflowTemplate.AllowDefaultContentApproval

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.workflow.spworkflowtemplate.allowdefaultcontentapproval.aspx

Gets or sets a value that indicates whether the workflow instances based on this template can start automatically when the user attempts to approve publishing a major version of an item.

true if the workflow instances based on this template can start automatically when the user attempts to approve publishing a major version of an item; otherwise, false.

SPWorkflowTemplate template = web.WorkflowTemplates.GetTemplateByBaseID(new Guid("AB81DB45-4CDD-4650-80CD-6EFC53D2D9EC")); 
               template.AllowDefaultContentApproval = false; 
0

I suppose this workflow is a custom created workflow?

Try to see this post if it helps

This is how to edit using SPD

Andrew

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.