2

I have a site with a list List1 and a workflow non reusable Workflow1 associated to this list, and defined to be started with creation of new entries. As I need to do some big changes in the workflow, I decided to create a new list List2 saving List1 as a template, and then I created a Workflow2 similar to Workflow1, associated to List2, so I can use List2 and Workflow2 as development/test.

Everything seems to be Ok, only that somehow the production Workflow1 is now associated to List2 additional to List1, so every time a new entry is created in List2, the Workflow1 is started.. When I go to List2 in Sharepoint Designer, under Workflows I see Workflow1 included, although Workflow1 was created only for List1. It looks like when saving the list as a template, the association with existing workflows is maintained, so a new list created with the template will have that association.

Is there any way using Sharepoint Designer to remove this association between List2 and Workflow1, without removing Workflow1? Or is there a way to avoid this Workflow1 to start with new items in List2, but continue starting with List1?

I was looking for possible answers to this, but all I found were references to remove the workflow, which is not possible here as the workflow is in Production. Thanks!

0

If you want to do this using designer, select the library, click on Workflow Associations, and that will take you to the library workflow association settings page in sharepoint. There click on Remove, block or restore a workflow, and there you have. Anyway, is there a reason why you want to use Designer instead of using the almight PowerShell?

$site= Get-SPSite SITEURL
if($site-ne $null)
{

    $Web = $site.rootWeb;
    # Get the list  to which we wanted to associate the workflow
    $SPList  = $Web.Lists[LISTNAME]; 

    $workflowAssociation  = $SPList.WorkflowAssociations.GetAssociationByName(YOUR ASSOCIATION NAME, [System.Threading.Thread]::CurrentThread.CurrentCulture);

    if($workflowAssociation  -ne $null)
    {
        #  Remove workflow association from list
        $SPList.RemoveWorkflowAssociation($workflowAssociation);
        $SPList.Update();
        Write-Host  “Workflow association removed Successfully.” -foregroundcolor  “Green”
     }
     else
     {
         Write-Host  “Workflow association could not be found.” -foregroundcolor  “Yellow”
     }
     $Web.Dispose()
}
$s.Dispose()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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