gpt4 book ai didi

sharepoint - 以编程方式将 SharePoint 工作流添加到列表

转载 作者:行者123 更新时间:2023-12-04 07:12:29 31 4
gpt4 key购买 nike

我们使用的是 SharePoint Foundation 2010。

我们创建了一个检查任务列表状态的工作流。

如果我们将工作流与 SharePoint UI 中的列表相关联,它就可以正常工作。

我们想知道如何自动关联它,也许在设置站点的功能接收器代码中?

最佳答案

// 1. create an instance of the SPWorkflowAssociation class
SPWorkflowAssociation workflowAssociation =
SPWorkflowAssociation.CreateListAssociation(workflowTemplate, associationName, taskList, historyList);

// 2. set start options
workflowAssociation.AllowManual = true;
workflowAssociation.AutoStartChange = false;
workflowAssociation.AutoStartCreate = false;

// 3. set additional association options (if any)
workflowAssociation.AssociationData = associationData;

// 4. add workflow association to the list
list.WorkflowAssociations.Add(workflowAssociation);

// 5. enable workflow association, so it is displayed in the user interface
workflowAssociation.Enabled = true;

关于sharepoint - 以编程方式将 SharePoint 工作流添加到列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3465645/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com