<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SharePoint Fun &#187; MOSS</title>
	<atom:link href="http://blog.qumsieh.ca/tag/moss/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.qumsieh.ca</link>
	<description>Developer's blog related to ASP.NET, SharePoint and Telerik Web Controls</description>
	<lastBuildDate>Tue, 27 Jul 2010 03:07:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>SharePoint Designer Custom Workflow &#8211; List Item Not Found</title>
		<link>http://blog.qumsieh.ca/2009/10/08/sharepoint-designer-custom-workflow-list-item-not-found/</link>
		<comments>http://blog.qumsieh.ca/2009/10/08/sharepoint-designer-custom-workflow-list-item-not-found/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 19:03:15 +0000</pubDate>
		<dc:creator>shereen</dc:creator>
				<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[Custom Activity]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[SharePoint Designer]]></category>
		<category><![CDATA[Workflows]]></category>
		<category><![CDATA[WSS]]></category>

		<guid isPermaLink="false">http://blog.qumsieh.ca/?p=516</guid>
		<description><![CDATA[So this particular error seems to be quite common, based on posts I&#8217;ve read here and here. If you&#8217;ve built a SharePoint Designer workflow and utilized the Update List Item activity, you may have run into a workflow error that logs an Outcome of: List Item Not Found For this particular scenario, here was my [...]]]></description>
			<content:encoded><![CDATA[<p>So this particular error seems to be quite common, based on posts I&#8217;ve read <a href="http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/c3f9f1e5-b868-4daf-b07f-034aeb8658bc" target="_blank">here</a> and <a href="http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_24445904.html" target="_blank">here</a>. If you&#8217;ve built a SharePoint Designer workflow and utilized the <strong>Update List Item</strong> activity, you may have run into a workflow error that logs an <strong>Outcome</strong> of:</p>
<blockquote><p><span style="color: #ff0000;">List Item Not Found</span></p></blockquote>
<p><span style="color: #ff0000;"><span style="color: #000000;">For this particular scenario, here was my setup:</span></span></p>
<ol>
<li>I have two lists: <strong>Survey</strong> and <strong>Customers</strong></li>
<li><strong>Survey</strong> has a custom column called <strong>Customer</strong> that is of type <strong>Lookup</strong>. This column is configured to lookup on the <strong>Title</strong> column in <strong>Customers</strong></li>
<li>My custom SD workflow has a single activity, the <strong>Update List Item</strong> activity, configured to update the <strong>Customers</strong> list, on the <strong>Survey Status</strong> column, and the criteria for determining what item to update is based on the <strong>Customer</strong> lookup in the <strong>Survey</strong> list</li>
</ol>
<p>Pretty straight forward stuff. I&#8217;ve done this a thousand times before and it&#8217;s worked without issue. However, I ran into a specific list where the workflow would error every single time, with the <span style="color: #ff0000;">List Item Not Found</span> message. Unfortunately, it&#8217;s very difficult to get any information other than what&#8217;s in the workflow history log. I attempted to read through the operations logs as well, but the information wasn&#8217;t really too helpful.</p>
<p>Doing some basic troubleshooting by adding an email activity and outputting the lookup variables in the body helped me determine that the <strong>Customer</strong> column in the <strong>Survey</strong> list was returning a blank value. That&#8217;s strange. Adding, editing and displaying items in the Customer list gives me no issue, I can select customers from my lookup and they read just fine. So why the heck does my workflow not properly record this value?</p>
<p>It gets a bit more puzzling when I grant myself <strong>Site Collection Administrator</strong> access to my site. Now all of a sudden, the workflow works and the lookup executes without issue. My entry in the Customers list is updated, all is happy for once. But granting users <strong>Site Collection Administration</strong> access is not a viable solution. It&#8217;s actually pretty crazy, so that&#8217;s not going to happen.</p>
<p>So after much frustration, I am sorry to report I don&#8217;t have much new information. What I did attempt to do however, was build my own version of the <strong>Update List Item</strong> activity in <strong>Visual Studio 2008</strong>. That turned out to be relatively straight forward. I used a bit of reflector to get the bits that I needed to successfully write this. That gave me the debugging capabilities that I desperately needed.</p>
<p>What I was now able to see with my custom activity was that the <strong>ListItem</strong> property was returning <strong>-1</strong>, and thus the <strong>GetItemById</strong> call on the <strong>Customers</strong> list was unable to find the item. Now why in the world was it returning <strong>-1</strong>? I&#8217;m still puzzled by this, and I&#8217;m not 100% sure if this is indeed a permissions related problem or if it&#8217;s something a entirely different.</p>
<p>I&#8217;m opening this up to anyone out there who might have some information regarding this particular issue. In the end, I wrote a custom Visual Studio sequential workflow, with literally 5 or so lines of code that essentially does the update for me and that runs without issue. I didn&#8217;t want to have to do that, but it was the only option I was left with for this particular list.</p>
<p>If anyone has any info, please drop me a line @ shereen at qumsieh dot ca. I would LOVE to get to the bottom of this.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.qumsieh.ca/2009/10/08/sharepoint-designer-custom-workflow-list-item-not-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
