创建每日列表项目计数 [英] Create a daily list item count
问题描述
您好,
我正在尝试创建一个只允许每天创建一定数量的新项目的列表表单。一种方法是在列表中创建项目的每日索引,然后创建一个不允许索引大于X的预保存验证。
I'm trying to create a list form that only allows to create a certain number of new items per day. One approach would be to create a daily index of items in the list and then create a pre-save validation that does not allow an index greater than X.
我坚持创建每日指数。能帮忙吗?
I am stuck at creating the daily index. Can you please help?
提前谢谢!
推荐答案
Hi Mircea,
Hi Mircea,
您可以参考"tom.vangaever"的建议;:
You can refer to the suggestion by "tom.vangaever":
You can loop by using a foreach on the List.Items and use the created field of the item, but that is not really best practice.
try to use a specfic SPQuery that returns only the items that are created the same date that the new event is added and check the amount of items this query results...
参考(尽管该文章用于日历列表,但对您也很有用):
Reference(although the article is for calendar list, but also useful to you):
您还可以参考这篇文章:
You can also refer to this article:
https://sharepoint.stackexchange.com/questions/150601/如何对限制最数的条目,记录到一个最大值-IN-A-列表 <跨度>&NBSP;
祝你好运,
Allen Bai
Allen Bai
这篇关于创建每日列表项目计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!