• 分配一个Task给多人或多个群组


     

    1 在Task列表中增加定制列ApprovalPersons,设置为People and Group类型,并允许多选。

    2 拖放onTaskCreated动作在CreatTask之后,并在其事件中执行如下

    SPList taskList = workflowProperties.TaskList;
                SPListItem taskItem = taskList.GetItemById(afterProps.TaskItemId);

                SPUser user;
                SPFieldUserValueCollection fuvc = new SPFieldUserValueCollection();

                string[] users = new string[] { "cts\\246373", "cts\\234337" };

                foreach (string loginName in users)
                {
                    user = workflowProperties.Web.EnsureUser(loginName);
                    fuvc.Add(new SPFieldUserValue(workflowProperties.Web, user.ID, user.Name));
                }

                taskItem["ApprovalPersons"] = fuvc;
                // note this causes onChanged event called
                taskItem.SystemUpdate(false);

  • 相关阅读:
    Apple Swift编程语言入门教程
    网络请求错误
    Mac使用大全
    MPMovieplayerController添加新控件
    ios9 新变化
    UITableView总结
    UINavigationController的简单学习
    HTML
    谓词(NSPredicate)
    NSString字符串
  • 原文地址:https://www.cnblogs.com/mingle/p/2308222.html
Copyright © 2020-2023  润新知