I had created a Custom Sequential Workflow in Visual Studio 2010 which runs when any Event is added in Calendar List. I have created a Custom Column named "Sequence". Now when I create any event in calender, Workflow Starts and makes 10 additional entries for same Data. What should I do to prevent it from creating 10 additional Entries?
This is How it looks when i create a new Item.
My Code is as below.
SPWeb web = workflowProperties.Web; SPList Calendar = workflowProperties.List; web.AllowUnsafeUpdates = true; Random randomNum = new Random(); SPListItem calendarItem = Calendar.Items.Add(); calendarItem["Sequence"] = randomNum.Next(); calendarItem.SystemUpdate(); web.AllowUnsafeUpdates = false;