Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

WorkflowAssociations.Update "There is already a workflow association with this name"

$
0
0

When I try to update a workflow that is bound to a content type, I get an error "There is already a workflow association with this name".

Since it is an update, this should work.  I got the code here:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontenttype.workflowassociations.aspx

                if (myContentType.WorkflowAssociations.GetAssociationByName(workflowAssociation.Name, web.Locale) == null)
                {
                    myContentType.WorkflowAssociations.Add(workflowAssociation);
                }
                else
                {
                    myContentType.WorkflowAssociations.Update(workflowAssociation); //this always gives an error
                }


Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>