I have a event receiver below that splits the filename up into parts and assigns them to the columns I added, Invoicemount, ExpenseType when a file is added. I did the following:
I upgraded to SPS2010 with July 2013 Service Pack.
Created a new document site with the 2 columns above, and the rest is set up as default.
Ensure the Event Receiver was activated for the site.
Checked out event viewer for errors (I even changed "Title" to "Titl" in the code below, yet I get no error that it couldn't find the column in event viewer (I have had that happen before))
It is almost like it is not being initiated when an item is added. What else can I look for?
/// List Item Events
public class EventReceiver1 : SPItemEventReceiver
/// An item was added.
public override void ItemAdded(SPItemEventProperties properties)
string tempFileName = properties.ListItem["Name"].ToString();
int fileExtPos = tempFileName.LastIndexOf(".");
if (fileExtPos >= 0)
tempFileName = tempFileName.Substring(0, fileExtPos);
string fileInfoParts = tempFileName.Split('_');
properties.ListItem["InvoiceAmount"] = fileInfoParts;
properties.ListItem["ExpenseType"] = fileInfoParts;
properties.ListItem["Title"] = properties.ListItem["Name"].ToString();