0

I have a workflow on a list that is started ONLY when a new item is created. I recreated this workflow in SharePoint Designer 2010 while looking at the old workflow from SharePoint Designer 2007. The list itself was migrated from 2007 to 2010 using a list template. The workflow uses 4 different send email events that are each in their own separate step.

The problem is that the workflow is running twice and 8 emails are sent instead of 4. I've checked the workflow history and ULS Viewer but I haven't found anything peculiar. How can I make sure that the workflow only fires once?

1
  • When migrating from SP2010 to SP2013 the same can happen, but the assembly is version 14.0.0.0 So change the line in the answer's powershell script to: $assembly = “Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” Apr 7, 2016 at 14:32

1 Answer 1

3

I found this article by SharelockPoint that states that lists that are migrated from SharePoint 2007 to SharePoint 2010 using list export/import will have event receivers for both SharePoint 2007 and SharePoint 2010 on the list. The solution is to delete the old 2007 receivers. Here is the code from the article that will fix the problem of the duplicate emails.

$spWeb = Get-SPWeb -Identity http://mySP2010site/mySP2010SubSite/
$spList = $spWeb.Lists["MyList"]
$eventsCount = $spList.EventReceivers.Count
$assembly = “Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”

for ($i = 0; $i -lt $eventsCount; $i+=1)
{
      write-host $spList.EventReceivers[$i].Assembly
   if ($spList.EventReceivers[$i].Assembly -eq $assembly)
   {
      write-host  “About to delete the reference”
      $spList.EventReceivers[$i].Delete()
   }
}

$spList.Update()

You can also solve this problem using SharePoint Manager 2010. All you have to do is:

  1. Go to where the site collection sits in the tree
  2. Go to "Lists -> My List -> Event Receivers"
  3. Click on each event receiver and look in the properties on the right to find out which ones use version 12.0.0.0 (SharePoint 2007).
  4. Right click on each one that is from SharePoint 2007 and select delete.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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