I remember doing this quite a bit...once upon a time.
The project: IS Service Request Form (SRF) System based in a Custom List.
The task: Send notification emails and update SRF Status field.
The problem: Changing the Status field from the ItemUpdating event.
Setting the status in the ItemAdded event is easy because it's asynchronous. The synchronous events (ending in -ing), require a different approach.
I had found a couple of blogs that suggested:
That didn't work. There was a variation that replaced the ".SystemUpdate(false)" with ".Update()" as well. That was also incorrect.
So after flailing around for way longer than I should have, I turned to Twitter to save me.
#SharePoint folks, I think I left my brain at #spconn09. I need to change a field value from an ItemUpdating event. How do I do it?Hafthor replied after a while with the correct answer:
@SamLarko properties.AfterProperties("fieldname")=valueSo, to sum it all up, set the field's AfterProperties value to whatever you want it to be, and that will be committed to the database at the end of the procedure.