Public Sub SystemUpdate
Dim instance As SPListItem instance.SystemUpdate
public void SystemUpdate ()
When you implement the SystemUpdate method, events are triggered and the modifications are reported in the Change and Audit logs, but alerts are not sent and properties are not demoted into documents.
The following code example uses the SystemUpdate method to make changes to a list item.
Dim siteCollection As New SPSite("http://MyServer ") Dim webSite As SPWeb = siteCollection.OpenWeb() Dim list As SPList = webSite.Lists("Announcements") Dim item As SPListItem = list.Items(0) item("Title") = "My New Title" item.SystemUpdate()
using (SPSite oSiteCollection = new SPSite("http://MyServer")) { using(SPWeb oWebsite = oSiteCollection.OpenWeb()) { SPList oList = oWebsite.Lists["Announcements"]; SPListItem oItem = oList.Items[0]; oItem["Title"] = "My New Title"; oItem.SystemUpdate(); } }
Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Best Practices: Using Disposable Windows SharePoint Services Objects.