<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: SharePoint Workflow Status: how to use the workflow status in a workflow (or a view)?</title>
	<atom:link href="http://www.officeandbusiness.be/2010/05/17/sharepoint-workflow-status-how-to-use-the-workflow-status-in-a-workflow-or-a-view/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.officeandbusiness.be/2010/05/17/sharepoint-workflow-status-how-to-use-the-workflow-status-in-a-workflow-or-a-view/</link>
	<description>SharePoint, GTD and beyond</description>
	<lastBuildDate>Fri, 27 Jan 2012 01:25:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Bharat</title>
		<link>http://www.officeandbusiness.be/2010/05/17/sharepoint-workflow-status-how-to-use-the-workflow-status-in-a-workflow-or-a-view/comment-page-1/#comment-3242</link>
		<dc:creator>Bharat</dc:creator>
		<pubDate>Fri, 27 Jan 2012 01:25:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.officeandbusiness.be/2010/05/17/sharepoint-workflow-status-how-to-use-the-workflow-status-in-a-workflow-or-a-view/#comment-3242</guid>
		<description>Hi,
When I attempt to use the Approval Status in a workflow, using &quot;If Approval Status equals 0;#Approved&quot; it doesn&#039;t recognise the approval status change after a document has been approved - so status changes from Pending to Approved. 

I need to be able to determine when an item is approved so a task can be assigned to various people to review it.

How can this be done?
Cheers,</description>
		<content:encoded><![CDATA[<p>Hi,<br />
When I attempt to use the Approval Status in a workflow, using &#8220;If Approval Status equals 0;#Approved&#8221; it doesn&#8217;t recognise the approval status change after a document has been approved &#8211; so status changes from Pending to Approved. </p>
<p>I need to be able to determine when an item is approved so a task can be assigned to various people to review it.</p>
<p>How can this be done?<br />
Cheers,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.officeandbusiness.be/2010/05/17/sharepoint-workflow-status-how-to-use-the-workflow-status-in-a-workflow-or-a-view/comment-page-1/#comment-3209</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Thu, 06 Oct 2011 00:52:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.officeandbusiness.be/2010/05/17/sharepoint-workflow-status-how-to-use-the-workflow-status-in-a-workflow-or-a-view/#comment-3209</guid>
		<description>That CAML query above didn&#039;t come out right because of the tags you have to use.  I&#039;ll attempt to write it again here:
string caml = @”&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&#039;ID&#039; /&gt;&lt;Value Type=&#039;Integer&#039;&gt;1&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;;</description>
		<content:encoded><![CDATA[<p>That CAML query above didn&#8217;t come out right because of the tags you have to use.  I&#8217;ll attempt to write it again here:<br />
string caml = @”&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&#8217;ID&#8217; /&gt;&lt;Value Type=&#8217;Integer&#8217;&gt;1&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.officeandbusiness.be/2010/05/17/sharepoint-workflow-status-how-to-use-the-workflow-status-in-a-workflow-or-a-view/comment-page-1/#comment-3208</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Thu, 06 Oct 2011 00:48:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.officeandbusiness.be/2010/05/17/sharepoint-workflow-status-how-to-use-the-workflow-status-in-a-workflow-or-a-view/#comment-3208</guid>
		<description>You can check the field of your workflow status by getting your SPListItem and calling its field.
using (SPWeb myWeb = SPContext.Current.Site.OpenWeb()) 
{ 

SPList myList = myWeb.GetList(&quot;/Lists/MyList&quot;);
SPQuery qry = new SPQuery();
string caml = @&quot;1;
SPListItemCollection myItemColl = myList.GetItems(qry);
SPListItem myItem = myItemColl[0];
object wfStatus = null;
wfStatus = myItem[&quot;WorkflowOnNew&quot;] != null ? myItem[&quot;WorkflowOnNew&quot;] : null;
if (wfStatus != null)
{
     switch (wfStatus.ToString())
     {
           case &quot;0&quot;:
                 wfStatus = &quot;Not Started&quot;;
                 break;
          case &quot;1&quot;:
                 wfStatus = &quot;Failed on Start&quot;;
                 break;
          case &quot;5&quot;:
                 wfStatus = &quot;Completed&quot;;
                 break;
      }
// Now do what you want with wfStatus, just remember you&#039;ll have to do &quot;.ToString()&quot; 
// on it because it&#039;s an object.

P.S.  I didn&#039;t do all the possible combinations of status numbers, this was just an 
example to get you started.  Find those at
http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/f5de7947-f49b-420a-b8d8-d44ad6b7769f/
and various other places around the &#039;net.


}</description>
		<content:encoded><![CDATA[<p>You can check the field of your workflow status by getting your SPListItem and calling its field.<br />
using (SPWeb myWeb = SPContext.Current.Site.OpenWeb())<br />
{ </p>
<p>SPList myList = myWeb.GetList(&#8220;/Lists/MyList&#8221;);<br />
SPQuery qry = new SPQuery();<br />
string caml = @&#8221;1;<br />
SPListItemCollection myItemColl = myList.GetItems(qry);<br />
SPListItem myItem = myItemColl[0];<br />
object wfStatus = null;<br />
wfStatus = myItem["WorkflowOnNew"] != null ? myItem["WorkflowOnNew"] : null;<br />
if (wfStatus != null)<br />
{<br />
     switch (wfStatus.ToString())<br />
     {<br />
           case &#8220;0&#8243;:<br />
                 wfStatus = &#8220;Not Started&#8221;;<br />
                 break;<br />
          case &#8220;1&#8243;:<br />
                 wfStatus = &#8220;Failed on Start&#8221;;<br />
                 break;<br />
          case &#8220;5&#8243;:<br />
                 wfStatus = &#8220;Completed&#8221;;<br />
                 break;<br />
      }<br />
// Now do what you want with wfStatus, just remember you&#8217;ll have to do &#8220;.ToString()&#8221;<br />
// on it because it&#8217;s an object.</p>
<p>P.S.  I didn&#8217;t do all the possible combinations of status numbers, this was just an<br />
example to get you started.  Find those at<br />
<a href="http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/f5de7947-f49b-420a-b8d8-d44ad6b7769f/" rel="nofollow">http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/f5de7947-f49b-420a-b8d8-d44ad6b7769f/</a><br />
and various other places around the &#8216;net.</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tyler</title>
		<link>http://www.officeandbusiness.be/2010/05/17/sharepoint-workflow-status-how-to-use-the-workflow-status-in-a-workflow-or-a-view/comment-page-1/#comment-3169</link>
		<dc:creator>Tyler</dc:creator>
		<pubDate>Wed, 13 Jul 2011 19:13:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.officeandbusiness.be/2010/05/17/sharepoint-workflow-status-how-to-use-the-workflow-status-in-a-workflow-or-a-view/#comment-3169</guid>
		<description>What do you do if you use custom names for your workflow status?</description>
		<content:encoded><![CDATA[<p>What do you do if you use custom names for your workflow status?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

