【问题标题】:Sharepoint: How to get value of the column?Sharepoint:如何获得列的价值?
【发布时间】:2010-07-26 14:37:48
【问题描述】:

我在 Sharepoint 中列出了新列“第一行批准者”。 此列的类型为“个人或组”,“允许多选”设置为“是”。

如何在运行时(从工作流)获取和修改此列的值?

【问题讨论】:

    标签: sharepoint sharepoint-2007


    【解决方案1】:

    假设您已将 WorkflowProperties 绑定到类..

    SPFieldUserValueCollection f= new SPFieldUserValueCollection(WorkflowProperties.Web,WorkflowProperties.ListItem["First line approvers"] + "");
    

    然后您可以遍历集合/修改集合并通过以下方式保存更改:

    WorkflowProperties.ListItem["First line approvers"] = f.ToString(); //You might not need the to string here, I can't remember. 
    

    【讨论】:

    • 我尝试了这种方法但不起作用:|来自工作流:SPFieldUserValueCollection f= new SPFieldUserValueCollection(workflowProperties.Web, workflowProperties.List.Fields["First line approvalrs"] + "");来自页面:SPFieldUserValueCollection f= new SPFieldUserValueCollection(Web, item.Fields["First line approvalrs"] + "");
    • ".ListItems" 需要字段或索引的 Guid...如果我尝试通过索引获取值,我也会获得空的 SPFieldUserValueCollection。
    猜你喜欢
    • 1970-01-01
    • 2013-08-06
    • 1970-01-01
    • 1970-01-01
    • 2022-08-14
    • 1970-01-01
    • 2018-04-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多