SharePoint 文档审批工作流程,按字段修改和批准

发布于 2024-12-13 11:47:46 字数 611 浏览 0 评论 0原文

我正在处理 SharePoint 文档审批流程,场景如下:文档上传到文档库中,并启动审批流程。创建任务并将其分配给一个组(Active Directory 组),其中只有一个组成员可以完成该任务。 所需要的是修改者和批准者字段,以显示完成任务的用户的名称,而不是任务分配到的组名称。

1) 我已经尝试过框工作流程,如果将系统帐户显示为完成任务的用户。 2)我尝试过SPD批准工作流程,它显示分配给的组名称。 3)我尝试过VS顺序工作流程:

使用VS工作流程,我可以将正确的用户设置为两个字段(修改者和批准者),最后一步我需要设置批准内容状态,如下所示

: .ModerationInformation.Status = SPModerationStatusType.Approved; (如果已批准)

但这以系统帐户权限运行,而不是当前用户,因此它将重置批准的字段返回系统帐户,如果我交换步骤顺序并首先设置内容状态,然后最后更新字段,显然我正在对该项目进行修改,因此内容状态会变回草稿。

有没有办法运行这个 item.ModerationInformation.Status = SPModerationStatusType.Approved;在当前用户下?或者有什么方法可以实现我的目标吗?

I working on a SharePoint document approval process and here is the scenario: A document is uploaded in the document library, and approval process is initiated. A task is created and assigned to a group (Active directory group) where only one group member can complete the task. What is required is the modified by and approved by fields to display the name of the user who completed the task and not the group name that the task is assigned to.

1) I have tried the out of the box workflow, and if displays system account as the user who completed the task.
2) I have tried SPD approval workflow, and it displays the group name assigned to.
3) I have tried VS sequential workflow :

With VS workflow, I’m able to set the correct user to the two fields (modified by and approved by) and as the last step I need to set the approval content status as follows:

item.ModerationInformation.Status = SPModerationStatusType.Approved; (if approved)

But this runs with system account permission and not the current user, so it resets the field approved by back to system account, and if I swap the sequence of my steps and set the content status first then update the fields last, obviously I’m doing a modification on the item so the content status changes back to draft.

Is there a way I can run this item.ModerationInformation.Status = SPModerationStatusType.Approved; under the current user? Or any way I can achieve my goal?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世界和平 2024-12-20 11:47:46

我建议保留系统列并根据您的目的创建一组完全不同的列。

因此,创建列:“项目修改者”、“项目批准者”,

然后将当前用户写入这些字段。

最后,从默认视图中删除系统生成的“修改者”和“批准者”,并将其替换为“项目修改者”和“项目批准者”列。

I would suggest leaving the system columns alone and creating a completely different set of columns for your purposes.

So Create the columns: "Item Modified By", "Item Approved By"

Then write the current user to these fields.

Lastly, remove the system generated "Modified By" and "Approved By" from the default view and replace them with your "Item Modified By" and "Item Approved By" columns.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文