When creating event receivers or workflows it might be interesting to
look at the differences between the following SPListItem methods. The
differences might be subtle but it can make a huge difference when you
have extra event receivers or workflows attached to your SharePoint list
or items.
You can also disable the triggering of events by using “this.EventFiringEnabled = false;”. Do your update and enable the events again with “this.EventFiringEnabled = true;”
Update()
- Updates the item in the database.
- Updates the “Modified” and “Modified by” values.
- Creates a new version
Systemupdate()
- Updates the item in the database.
- No changes in the “Modified” and “Modified By” fields.
- No new version.
- Triggers the item events.
Systemupdate(true)
- Same as Systemupdate() and increments the item version.
- Using SystemUpdate(false) is exactly the same as SystemUpdate()
UpdateOverwriteVersion()
- Updates the item but does not create a new version.
- Updates the “Modified” and “Modified by” values.
You can also disable the triggering of events by using “this.EventFiringEnabled = false;”. Do your update and enable the events again with “this.EventFiringEnabled = true;”
No comments:
Post a Comment