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

Content Type changes not being pushed to child content types

$
0
0

Hi,

We are working on updating the properties of one of the Review workflow associated with a site content type and pushing the changes to relevant list CTs and the child CTs inherting the content type. Here is the code snippet. But the below code works only for site Content Type but doesn't propagate changes to child CTs and list CTs.

The propagation works if we make the changes directly through the UI. But doesn't work through object model or powershell. Any clue or any help is much appreciated

 SPSecurity.RunWithElevatedPrivileges(delegate()
           {
               using (SPSite site = new SPSite("sitenamef"))
               {
                   using (SPWeb web = site.OpenWeb())
                   {
                       SPContentType ct = web.ContentTypes["CTName"];

                       SPWorkflowAssociation workflowassocation = ct.WorkflowAssociations.GetAssociationByName("Review", web.Locale);

                       Console.WriteLine(workflowassocation.AssociationData);
                       workflowassocation.AssociationData.Replace(">Serial<", ">Parallel<");

                       ct.WorkflowAssociations.Update(workflowassocation);
                       ct.UpdateWorkflowAssociationsOnChildren(true, true, true, true);
                       Console.WriteLine(workflowassocation.AssociationData);
                       ct.Update(true);

                       
                   }
               }
           });


Viewing all articles
Browse latest Browse all 11571

Trending Articles



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