开发者

how to know the end of loop in sharepoint designer workflow?

开发者 https://www.devze.com 2022-12-19 17:16 出处:网络
in moss 2007 service pack 2 i have designed a sharepoint designer looping workflow which processes each item in the list and keeps track of the last item processed by using the flag column in the lis

in moss 2007 service pack 2

i have designed a sharepoint designer looping workflow which processes each item in the list and keeps track of the last item processed by using the flag column in the list .

initially all items in the list have flag column value = no

the looping workflow first looks for the first item in the list with flag = no

after proecessing this item i开发者_Go百科t turns its flag to yes. then it only processes the next item.

on reaching the last item in the list it processes it and then turns its flag to yes.

the looping workflow then ends with the error list item not found because in next iteration it does not find any no flagged item.

my problem is - how can i know that the last item has been processed. so that i can then start a workflow to reset all flags to no again to make the orignal workflow usable again.


Create a condition If [Field in the Current Item] equals to [Value] and only executes the actions if this condition is met, otherwise it will exit the workflow.


Doing any kind of looping in SharePoint workflows is painful to say the least. Your approach will almost certainly cause concurrency problems as well if the flow is triggered more than once at a time.

For these kind of complex requirements you may want to look at third party software. I am biased as I worked on this product, but you may want to consider the Workflow Power Pack, which allows C# or VB code to be embedded directly into SharePoint Designer workflows without complex Visual Studio development cycles.

If you don't want to go down the 3rd party avenue then check out the following articles.

  • http://blogs.msdn.com/sharepointdesigner/archive/2009/07/13/service-pack-2-prevents-an-on-change-workflow-from-starting-itself.aspx

  • http://blog-sharepoint.blogspot.com/2010/01/sharepoint-looping-workflow-how-to-loop.html

0

精彩评论

暂无评论...
验证码 换一张
取 消