item.SystemUpdate() - It is used when we do not want fields such as Modified,ModifiedBy gets updated or if we do not want a new version should be created.
In the below code I used to get SharePoint List Item from different method and then update it.
  1. using (SPSite site = new SPSite(SPContext.Current.Site.ID))
  2. {
  3. using (SPWeb web = site.OpenWeb())
  4. {
  5. SPListItem item = GetItem("TestListSite1", 1);
  6. web.AllowUnsafeUpdates = true;
  7. item["Title"] = "Update List Item";
  8. item.SystemUpdate();
  9. web.AllowUnsafeUpdates = false;
  10. //remaining code
  11. }
  12. }
Executing the above code gave an error below.
After searching I found that we should make AllowUnsafeUpdates = true of the item that we are updating and since I was getting item from a different method I used the below code.
The only change I made is this item.Web.AllowUnsafeUpdates = true;
  1. using (SPSite site = new SPSite(SPContext.Current.Site.ID))
  2. {
  3. using (SPWeb web = site.OpenWeb())
  4. {
  5. SPListItem item = GetItem("TestListSite1", 1);
  6. item.Web.AllowUnsafeUpdates = true;
  7. item["Title"] = "Update List Item";
  8. item.SystemUpdate();
  9. item.Web.AllowUnsafeUpdates = false;
  10. }
  11. }
By using above code I was successfully able to update the list item using item.SystemUpdate();