SPListItem.SystemUpdate method

Updates the database with changes made to the list item without changing the Modified or Modified By fields.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

'Declaration
Public Sub SystemUpdate
'Usage
Dim instance As SPListItem

instance.SystemUpdate()

When you call 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.

Calling this method is the same as calling SystemUpdate(Boolean) with false.

The following example is a console application that uses the SystemUpdate method to make changes to a list item.

Imports System
Imports Microsoft.SharePoint

Module ConsoleApp
   Sub Main()
      Using site As SPSite = New SPSite("http://localhost")
         Using web As SPWeb = site.OpenWeb()

            Dim list As SPList = web.GetList("/lists/announcements/")
            If list.ItemCount > 0 Then
               ' Get an item to modify.
               Dim item As SPListItem = list.Items(0)

               ' Report the current state of the item.
               ReportState("Before", item)

               ' Modify it.
               If item.HasUniqueRoleAssignments Then
                  item.ResetRoleInheritance()
               Else
                  item.BreakRoleInheritance(True)
               End If

               ' Update without changing the modified time.
               item.SystemUpdate()

               ' Report the new state of the item.
               ReportState("After", item)
            End If

         End Using
      End Using

      Console.ReadLine()
   End Sub

   Sub ReportState(ByVal state As String, ByVal item As SPListItem)
      Console.WriteLine(state)
      Console.WriteLine("HasUniqueRoleAssigments: {0}", item.HasUniqueRoleAssignments)
      Console.WriteLine("Modified: {0}", item(SPBuiltInFieldId.Modified))
      If item.Fields.ContainsField("Modified_x0020_By") Then
         Console.WriteLine("Modified by: {0}", item(SPBuiltInFieldId.Modified_x0020_By))
      End If
      Console.WriteLine()
   End Sub

End Module
Show: