A user has a list that has a couple fields that are often updated. He wants to store the prior values in some other fields on the item when the item is updated (yes, I know versioning would be easier, but I'm at his mercy here). So I need to move the old values of these fields to different fields.
I am using an ItemUpdating event receiver (in 2010). The code seems pretty straightforward, but I can't get the the fields to update. Even when hard-coding the values, the code runs successfully but the values aren't saved. I tried ItemUpdated, which will update the values, but it's not going to work for my solution. Am I missing something here? Sample:
Public Overrides Sub ItemUpdating(properties as SPItemEventProperties) MyBase.ItemUpdating(properties) Dim currentItem As SPListItem = properties.ListItem Using Web As SPWeb = properties.OpenWeb() Me.EventFiringEnabled = False Web.AllowUnsafeUpdates = True currentItem("PriorPrice") = 5.25 currentItem.SystemUpdate(False) Web.AllowUnsafeUpdates = False Me.EventFiringEnabled = True End Using End Sub