Tuesday, January 6, 2015

SharePoint Workflow Association to SharePoint List

The below code is used to associate the workflow to the list as well as the update the workflow association to the sharepoint list

 // Add workflow association to my list
                        if (hasWorkflowAssociation == null)
                        {
                            sharePointSitesList.WorkflowAssociations.Add(workflowAssociation);
                            // Enable workflow
                            workflowAssociation.Enabled = true;
                        }
                        else
                        {
                            hasWorkflowAssociation.Enabled = true;
                            sharePointSitesList.UpdateWorkflowAssociation(hasWorkflowAssociation);
                            sharePointSitesList.Update();
                        }

No comments:

Post a Comment