Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
add comment

3 Answers

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

SPList.DefaultContentApprovalWorkflowId

share|improve this answer
add comment

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

share|improve this answer
add comment

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; 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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