Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

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.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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