将现有网站栏添加到自定义列表
我想我快要疯了——这看起来很容易做到,但我根本找不到任何相关信息。
我创建了一个自定义列表并向其中添加了 4 列。创建者和修改者已在列表中,但在视图中隐藏。
我想向此自定义列表添加“修改日期”列(这是内置字段)。我如何以编程方式执行此操作?
I think I'm going mad - this seemed like an easy thing to do but I can't find any info on it at all.
I have created a Custom List and added 4 columns to it. Created By and Modified By are already in the list but hidden from the view.
I want to add a Date Modified column (which is a built in field) to this Custom List. How do I do this programmatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否正在尝试将该列添加到列表或视图中?默认情况下,“修改日期”列应添加到列表中。要将其添加到视图中(即,当您导航到列表时它会显示),您可以使用类似于以下的代码:
Are you trying to add the column to the list or to a view? The Date Modified column should be added to the list by default. To add it to the view (i.e. so it shows up when you navigate to the list) you can use code similar to the following:
使用共享点,有时你必须做一些丑陋的事情……你不希望你的孩子长大后知道的事情。
这是一个可怜的解决方案:
- 您可以像其他任何字段一样创建日期时间字段。
- 当数据更改时,您创建一个工作流程,工作流程启动,更新您的自定义修改字段,然后停止。
无论如何,我知道可以显示默认的“修改”字段,也许您想朝这个方向多走一点。
With sharepoint sometimes you must do ugly things... stuff you would not want your children know when they grow up.
Here is a pitifull solution:
- you create a DateTime field just like any other.
- you create a workflow when data changes, workflow starts, updates that your custom modified field and then stops.
ANYWAY, I know it is possible to show the default Modified field, perhaps you wanna go in that direction a little bit more.