简体   繁体   English

Visual Studio工作流的SharePoint任务列表中的“查找”列

[英]Lookup column in SharePoint Task List of a Visual Studio Workflow

I have a State Machine SharePoint 2010 Workflow. 我有一个状态机SharePoint 2010工作流。 The task is created by content type. 任务是按内容类型创建的。 I wanted to add a lookup column in task list. 我想在任务列表中添加查找列。 I was able to successfully add values to other custom field into the task list but having problem when I try add values to the lookup column of the task list. 我能够成功将值添加到任务列表中的其他自定义字段,但是在尝试将值添加到任务列表的查找列时遇到问题。

Following code snippets were from CreateApproverTaskWithCT method. 以下代码段来自CreateApproverTaskWithCT方法。

//**I amable to add values to custom columns like this
createApproverTaskWithCT_TaskProperties1.ExtendedProperties[GetField("StatusReview")] = "Pending";

//**I am not able to add values to lookup column
createApproverTaskWithCT_TaskProperties1.ExtendedProperties[GetField("AgencyNameLookup")] = new SPFieldLookupValue(agencyItem.ID, agencyItem["Agency Legal Name"].ToString());

where agencyItem is a SPListItem for the corresponding lookup column. 其中agencyItem是对应查找列的SPListItem。 and GetField method return the guid of the custom field. 和GetField方法返回自定义字段的GUID。

private Guid GetField(string field_name) { Guid statusFieldId = workflowProperties.TaskList.Fields.GetFieldByInternalName(field_name).Id; return statusFieldId; }

Any suggestions would be highly appreciated. 任何建议将不胜感激。

我可以通过以下方法插入值以在任务列表中查找字段:

createApproverTaskWithCT_TaskProperties1.ExtendedProperties[GetField("AgencyNameLookup")] = String.Format(agencyItem.ID + ";#" + agencyItem["Agency Legal Name"].ToString());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SharePoint 2013 Visual Studio工作流程清单IId - SharePoint 2013 Visual Studio Workflow ListIId Sharepoint工作流程任务列表标题URL - Sharepoint Workflow Task List Title URL 尝试使用Visual Studio 2017将现有网站列添加到自定义列表| (Sharepoint)[Microsoft.Sharepoint.Client] - Trying to add existing site column to the custom list using Visual Studio 2017 | (Sharepoint) [Microsoft.Sharepoint.Client] Visual Studio 2013问题的SharePoint工作流参考Microsoft.activities - sharepoint workflow with visual studio 2013 problem reference Microsoft.activities 在Visual Studio 2010中为Sharepoint 2010合并工作流启动信息路径表单 - Incorporating a workflow Initiation Infopath form in Visual Studio 2010 for Sharepoint 2010 Visual Studio 2010中的Sharepoint列表适配器 - Sharepoint list adapter in visual studio 2010 Visual Studio - 获取任务列表的注释标记 - Visual Studio — get comment tokens of Task list 绑定工作流属性以列出Visual Studio 2010中的项目 - Bind workflow properties to list items in Visual Studio 2010 Sharepoint 2010自动生成的工作流程列 - Sharepoint 2010 autogenerated workflow column 如何:使用自定义列表共享点工作流 - How to: sharepoint workflow with custom list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM