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

Workflow has to start automatically when an item is created in the SharePoint list. After that it has to copy the record and add five times into the same list. Problem that I faced it executing (coping) indefinitely, I am just trying to stop the execution after the fifth time, but I couldn’t is there any possibility achieve this scenario. Thanks in advance

share|improve this question
    
Do you actually require a workflow? Can you use an event receiver? In this case, you can disable the event firing while creating the other items. –  Steve B Aug 22 '12 at 14:24
add comment

1 Answer

Your problem is that each time the workflow runs it creates 5 copies, which each triggers the workflow which create 5 copies, which each triggers the ...

You have two options, but both require an extra field:

  • Have a field CopyNumber, make your workflow only create a copy when this is below 5 and increment it in the copy
  • Have a some field Copy/Source which tells if the item is a copy, make your workflow to not make copies when this field is set and set it in the 5 copies it create

Number 2 is the one that performs best and may also give the benifit of telling which item this is a copy of.

share|improve this answer
    
Thanks for your time, I'll heading on the second option –  Nats Aug 23 '12 at 6:30
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.