如何从自定义 Sharepoint 工作流程中关联项目的字段中提取值?
我正在 Visual Studio 2008 中创建自定义 WSS 工作流程,并有一个“创建任务”活动。 创建任务时,我希望能够引用与工作流程关联的列表项中的一些字段值,并且在我的一生中,我似乎无法确定如何获取该工作流字段中的值物品。 我知道您可以使用:
workflowProperties.Item
访问项目本身,但如果我想检索该项目上名为“请求金额”的字段的值,我将如何做? 我见过“GetFromattedValue(string)”方法,但我并不真正想要格式化的值,原始字符串值确实是我想要的。
I'm creating a custom WSS workflow in Visual Studio 2008 and have a 'create task' activity. When creating the task I want to be able to reference some of the field values from the list item that is associated with the workflow and for the life of me I can't seem to determine how to get at the values within the fields on that item. I know that you can use:
workflowProperties.Item
to access the item itself, but if I want to retrieve the value of a field on that item that's called 'Amount Requested' how would I go about doing that? I've seen the 'GetFromattedValue(string)' method, but I don't really want the formatted value, a raw string value is really all I want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
flowProperties.Item 只是一个 SPListItem,这意味着您可以使用 SPListItem["named_column"] 访问它:
SPListItem item =workflowProperties.Item;
string amountRequested = item["请求金额"];
.b
workflowProperties.Item is just an SPListItem, meaning you can access it using SPListItem["named_column"]:
SPListItem item = workflowProperties.Item;
string amountRequested = item["Amount Requested"];
.b