SharePoint : The difference and relation between SPListItem.Update and SPListItem.SystemUpdate Methods 【转载】

本文探讨了SharePoint开发中SPListItem.Update与SPListItem.SystemUpdate方法的不同之处。前者更新列表项并记录修改时间及修改人;后者同样保存更改,但不更新修改时间和修改人字段。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://www.nanmu.net/keli/blog/Lists/Posts/Post.aspx?ID=93

    You may have used SPListItem.Update() method in sharepoint development, but you may don't know about SPListItem.SystemUpdate() method. Now we talk about the difference and relation about them.

    First, let's see the SDK's description:

  • SPListItem.Update(), Updates the database with changes that are made to the list item.

  • SPListItem.SystemUpdate(),Updates the database with changes made to the list item, without effecting changes in the Modified or Modified By fields.

  • SPListItem.SystemUpdate(bool incrementListItemVersion),Updates the database with changes that are made to the list item, without effecting changes in the Modified Time or Modified By fields, or optionally, the item version.

    Now we can see, the same appointment is they are save the item changes to database. But, the Update method will effectint the modified time and Modified By Fields, the systemupdate method will not.

 

这是一个不怎么起眼的技术细节,SPListItem.SystemUpdate会保存更改,但不会保存更改时间,以及修改人。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值