This is handy. SharePoint helpfully populates the meta data with the GUID of the list and the ID of the item a WF instance is associated with. These are stored in "ows_WorkflowListId" and "ows_WorkflowItemId" fields on the task list item.

An example of using this is from an InfoPath form in the form load code behind.

SPListItem currentListItem = SPContext.Current.ListItem;
if (currentListItem != null)
{
object associatedWfListId = currentListItem["ows_WorkflowListId"];
object associatedWfItemId = currentListItem["ows_WorkflowItemId"]; if (associatedWfItemId != null && associatedWfListId != null)
{
SPListItem item = web.Lists.GetList(new Guid(associatedWfListId.ToString()), false).GetItemById(int.Parse(associatedWfItemId.ToString()));
// THE ABOVE ITEM IS THE ASSOCIATED LIST ITEM
}
}

Get the item a SharePoint workflow task is associated with的更多相关文章

  1. Get item by sharepoint web service jquery

    对于sp2010,在ie浏览器中这个代码无法生效,只有chrome可以生效. //获取附件id function GetAttachments(listName) { var soapEnv = '& ...

  2. sharepoint workflow不能正常使用

    程序集“Microsoft.SharePoint.WorkflowServices, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce ...

  3. To get TaskID's Integer ID value from the GUID in SharePoint workflow

    list.GetItemByUniqueId(guid).ID int itemID = spList.Items[new Guid("")].ID;

  4. Creating a SharePoint Sequential Workflow

    https://msdn.microsoft.com/en-us/library/office/hh824675(v=office.14).aspx Creating a SharePoint Seq ...

  5. This task is currently locked by a running workflow and cannot be edited

    转自:http://geek.hubkey.com/2007/09/locked-workflow.html 转自:http://blogs.code-counsel.net/Wouter/Lists ...

  6. SharePoint 2013 Nintex Workflow 工作流帮助(八)

    博客地址 http://blog.csdn.net/foxdave 工作流动作 15. Complete Workflow Task(User interaction分组) 此工作流动作将完成任何进行 ...

  7. SharePoint 2013 create workflow by SharePoint Designer 2013

    这篇文章主要基于上一篇http://www.cnblogs.com/qindy/p/6242714.html的基础上,create a sample workflow by SharePoint De ...

  8. approval workflow in sharepoint designer

    http://office.microsoft.com/en-us/sharepoint-designer-help/video-create-an-approval-workflow-in-shar ...

  9. SharePoint 2013 Nintex Workflow 工作流帮助(十三)

    博客地址 http://blog.csdn.net/foxdave 工作流动作 35. Delegate Workflow Task(User interaction分组) 该操作将委托未处理的工作流 ...

随机推荐

  1. [改善Java代码]推荐在复杂字符串操作中使用正则表达式

    一.分析  字符串的操作,诸如追加.合并.替换.倒序.分隔等,都是在编码过程中经常用到的,而且Java也提供了append.replace.reverse.split等方法来完成这些操作,它们使用起来 ...

  2. [改善Java代码]不推荐使用binarySearch对列表进行检索

    对一个列表进行检索时,我们使用的最多的是indexOf方法,它简单好用,而且也不会出错,虽然它只能检索到第一个符合条件的值,但是我们可以生成子列表后再检索.这样也就可以查找到所有符合条件的值了. Co ...

  3. [改善Java代码] 谨慎包装类型的大小比较

    建议27:谨慎包装类型的大小比较 基本数据类型比较大小木有问题,不过其对应的包装类型大小比较就需要注意了.看如下代码: public class Client { public static void ...

  4. poj 3264 RMQ

    直接写个RMQ就能过. #include<iostream> #include<cstdio> #include<cstring> #include<algo ...

  5. poj 1364 差分约束

    思路:设dis[i]为从0点到第i点的序列总和.那么对于A B gt  k 来讲意思是dis[B+A]-dis[A]>k; 对于A B lt k来讲就是dis[B+A]-dis[A]<k; ...

  6. 命令行创建Windows窗体应用程序

    csc:(C Sharp Compiler) 类似于 javac (java Compiler) 命令行的编译工具 位置:C:\Windows\Microsoft.NET\Framework\v4.0 ...

  7. (转)C#模拟键盘鼠标事件

    原文 1.模拟键盘事件System.Windows.Forms.SendKeys以下是   SendKeys   的一些特殊键代码表.     键   代码       BACKSPACE   {BA ...

  8. UML学习-总体概念篇

    前言:我们在实施一个项目时,前期的设计是非常重要的,如建筑师在建造一个建筑时,需要事先设计图纸,设计图纸是设计的语言,是不同的工程设计人员.设计人员和生产人员之间进行沟通的语言,在一个现代化的工程里面 ...

  9. Android实现贪吃蛇游戏

    [绥江一百]http://www.sj100.net                                                  欢迎,进入绥江一百感谢点击[我的小网站,请大家多 ...

  10. C#操作Excel数据增删改查示例

    Excel数据增删改查我们可以使用c#进行操作,首先创建ExcelDB.xlsx文件,并添加两张工作表,接下按照下面的操作步骤即可 C#操作Excel数据增删改查. 首先创建ExcelDB.xlsx文 ...