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. 【Stirling Number】

    两类Stirling Number的简介与区别(参考自ACdreamer的CSDN) Stirling Number I --- s(n,k):将n个物体排成k个非空循环排列(环)的方法数. 递推式: ...

  2. MyBatis(3.2.3) - Handling the CLOB/BLOB types

    MyBatis provides built-in support for mapping CLOB/BLOB type columns. Assume we have the following t ...

  3. Linux 命令 - ls: 列出目录内容

    ls 命令很可能是用户最常使用的命令,通过 ls 命名可以查看目录内容,确定各种重要文件和目录的属性. 命令格式 ls [OPTION]... [FILE]... 命令参数 -a, --all 列出所 ...

  4. Linux 命令 - mkdir: 创建目录

    命令格式 mkdir [OPTION]... DIRECTORY... 命令参数 -m, --mode=MODE 设置文件的模式,类似于 chmod 命令. -p, --parents 需要时创建指定 ...

  5. Linux 命令 - jobs: 显示后台作业的状态信息

    命令格式 jobs [-lnprs] [jobspec ...] jobs -x command [args] 命令参数 -l 额外显示作业的进程 ID. -n 只列出状态发生变化的进程. -p 只列 ...

  6. SQL_CURSOR_游标循环

    ) DECLARE My_Cursor CURSOR --定义游标 FOR (SELECT column1 FROM #temp1) --查出需要的集合放到游标中 OPEN My_Cursor; -- ...

  7. OC2_ARC MRC混合编程

    // // main.m // OC2_ARC MRC混合编程 // // Created by zhangxueming on 15/6/19. // Copyright (c) 2015年 zha ...

  8. Javascript基本格式

    Javascript基本格式 ① JavaScript区分大小写 只要一门语言是面向对象的,其都是区分大小写,所以在Javascript中,变量小i与变量I是两个完全不同的变量 ② JavaScrip ...

  9. Contest1065 - 第四届“图灵杯”NEUQ-ACM程序设计竞赛(个人赛)D拿糖果

    题目描述 薯片和他的朋友薯条来到了商店,商店有n个糖果,标号依次为1,2,3....n,对应的价值为W1,W2,W3...Wn.现在薯片先拿走一个标号为a的糖果,标号小于a的糖果就被商家收回去了,然后 ...

  10. nginx上传文件

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...