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

I've got a few lines of code which programmatically add a workflow to a list content type. This works ok, but it also automatically adds a column to the default view of this list. I don't want that to happen, but I cannot find a way to prevent it. Of course I can retrieve the view again and delete the newly added column, but that seems a bit foolish.

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

SPWorkflowTemplate and SPWorkflowAssociation has an option for StatusColumn.

"True to display a status column for workflow instances based on this workflow template in the user interface."

"True to display a status column for this workflow association in the user interface."

Try setting it to false.

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

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.workflow.spworkflowassociation.statuscolumn.aspx

Haven't tested it.

share|improve this answer
3  
SPWorkflowAssociation.StatusColumn is readonly. But if you set SPWorkflowTemplate.StatusColumn to false and pass it to the SPWorkflowAssociation constructor, then the association's StatusColumn will be false. –  Rich Bennema May 8 '12 at 17:35
add comment

This appears to work when creating an association, you can edit the template to set the StatusColumn to false at the point of setting the association, but you cannot edit this after the association is created.

Thanks for this info, it led me to the answer as well!!

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.