我们知道,工作流的任务列表有一个名为Related content
的列。如何获取特定任务项的Related Content
的值。我尝试了以下方式,但没有成功。
var campaignTaskList = currentWeb.Lists["CampaignTask"].Items;
var currentUserTaskList = (from SPListItem taskItem in campaignTaskList
let assignTo = new SPFieldUserValue(taskItem.Web, taskItem["Assigned To"].ToString())
where assignTo.User.Name == currentWeb.CurrentUser.Name
select taskItem).ToList();
foreach (SPListItem workflowTaskItem in currentUserTaskList)
{
var item = workflowTaskItem["Related Content"].ToString();
}
答案 0 :(得分:2)
Related Content
字段声明:
<Field ID="{58DDDA52-C2A3-4650-9178-3BBC1F6E36DA}"
Name="WorkflowLink"
SourceID="http://schemas.microsoft.com/sharepoint/v3"
StaticName="WorkflowLink"
Group="_Hidden"
Type="URL"
DisplayName="$Resources:core,LinkField;"
ReadOnly="TRUE"
Sealed="TRUE">
</Field>
按field Id:
var relContent = item[SPBuiltInFieldId.WorkflowLink];
按字段名称:
var relContent = item["WorkflowLink"];