启动 Sharepoint 工作流程“x” 到期日之前的天数
我想在 Sharepoint 列表上创建工作流程,它应该发送通知电子邮件。
问题是我希望此工作流程基于到期日期(在到期日期前 30 天发送电子邮件),并且我不创建或更新任何新的列表项。
我知道只有在更改/创建任何项目时才能创建工作流程,但我在网上看到一些传言称这可以使用 SPD 实现。
任何建议将不胜感激。
谢谢,
I want to create a workflow on a Sharepoint list and it should send a notification email.
The problem is that I want this workflow based on expiry date(send an email 30 days before the expiry date) and I am not creating or updating any new list items.
I know workflow can only be created if any item are changed/created but I have seen some buzz around on the net that this can be possible using SPD.
Any suggestions would really be appreciated.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这应该会给您一个良好的开端 - 它涵盖工作流程、计时器作业和一些可以完成您所需任务的第三方产品。
sharepoint 日历中的日期提醒
This should give you a good start - it covers workflow, timer jobs and some 3rd party products that can do what you are after.
Dated reminders in sharepoint calendars
创建项目时创建工作流程。 不要使用“暂停直到(ExpiryDate -30)”发送电子邮件。 这样做的一个大问题是用户可能会更改到期日期。
我的建议是使用Pause几天,比如1天。 逻辑是这样的。
在“操作”部分中添加以下三个操作:
- 添加迄今为止的时间(-30 天)
当今天 <= expiryDate 时循环(如果用户更改它,则更改) - 30
暂停 1 天
发送电子邮件
,每当用户更改到期日期时,每次迭代都会获取它。
Create a workflow when the item is created. Do not use Pause Until(ExpiryDate -30) send Email. there is a big issue with this is that users may change the expiry date.
My suggestion is to use Pause some days, such as 1 day. the logic would be like this.
In the Actions section add these three actions:
- Add time to date (-30 days)
loop while today <= expiryDate (changed if user change it) - 30
Pause 1 day
Send email
in this case, whenever the users change the expire date, it will get it for each iteration.
您可以创建一个工作流程,以在创建或修改项目时启动。 此工作流程通过将到期日期文件与当前日期进行比较来检查日期是否到期。 如果未到期,请将工作流程设置为暂停 1 天,然后修改列表中的任何字段(您可以创建一个不执行任何操作但仅用于此目的的字段)。 修改后,工作流程终止,但修改将触发另一个工作流程,该工作流程将再次检查到期日期并暂停另一天,直到匹配到期日期。
You can create a workflow to start when item is created or modified. This work flow check whether the date is due by comparing due date files with current date. If it is not due, set the workflow to pause for 1 day then modify any field in the list (you can create a field that does nothing but just for this purpose). Once modified, the workflow terminates but the modification will trigger another workflow, that workflow will check the due date again and pause for another day until the due date is matched.
可能的解决方法是在创建/更新时启动设计器工作流程。 在工作流程中使用“暂停直到”条件,如下所示:
暂停直至 (ExpiryDate-30)
发送电子邮件
“暂停直到”条件暂停当前工作流实例,直到指定日期到来。 这很可能会解决您的问题。
谢谢,
-Aniket Banerjee,Mindfire Solutions 高级 SharePoint 开发人员
The possible work around would be to start a designer workflow when the is created/updated. Within the workflow use 'Pause Until' condition as shown below:
Pause until (ExpiryDate-30)
Send Email
The 'Pause Until' condition pauses the current workflow instance untill the specified date comes. This is likely to solve your problem.
Thanks,
-Aniket Banerjee, Senior SharePoint Developer, Mindfire Solutions
创建 SharePoint Designer (SPD) 工作流
选择您的任务列表
将其设置为在创建时运行
点击下一步
在“操作”部分中添加以下三个操作:
- 添加迄今为止的时间
- 暂停直到日期
- 发送电子邮件
设置属性后,我的示例如下所示:
将 -7 天添加到任务:截止日期(输出到变量:ReminderDate)
然后暂停直到变量:提醒日期
然后通过电子邮件发送此消息(您可以对地址进行硬编码或使用分配给...)
这个非常简单的示例的注释:
- 如果有人编辑任务并设置新的截止日期,此工作流仍将根据旧日期发送提醒。
- 它不会检查到期日是否至少是未来两天。
参考:http://social.msdn.microsoft.com/Forums/en-US/acb12dd2-d6a5-4b7e-b233-037558bfa2e5/start-workflow-x-days-before-expiry-date ?forum=sharepointcustomizationlegacy
Create a SharePoint Designer (SPD) workflow
Select your task list
Set it to run on Create
Click Next
In the Actions section add these three actions:
- Add time to date
- Pause until date
- Send email
My example looks like this after the properties are set:
Add -7 days to Tasks:Due Date (Output to Variable: ReminderDate)
then Pause until Variable: Reminder Date
then Email this message (you can hard code the address or use the assigned to... )
Notes for this very simple example:
- If someone edits the task and sets a new due date, this workflow will still send the reminder based on the old date.
- It does not check to see if the Due Date is at least two days in the future.
Ref: http://social.msdn.microsoft.com/Forums/en-US/acb12dd2-d6a5-4b7e-b233-037558bfa2e5/start-workflow-x-days-before-expiry-date?forum=sharepointcustomizationlegacy