event receiver not triggering for itemadded

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?
Thanks


using System;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Workflow;

namespace splitname.EventReceiver1
{
    /// <summary>
    /// List Item Events
    /// </summary>
    public class EventReceiver1 : SPItemEventReceiver
    {
       /// <summary>
       /// An item was added.
       /// </summary>
        public override void ItemAdded(SPItemEventProperties properties)
        {
            base.ItemAdded(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[0];
            properties.ListItem["ExpenseType"] = fileInfoParts[1];
            properties.ListItem["Title"] = properties.ListItem["Name"].ToString();
            properties.ListItem.Update();

        }


    }
}
BKennedy2008Asked:
Who is Participating?
 
Rainer JeschorCommented:
Hi,
have you restarted the Windows SharePoint Timer Service and ran an IISRESET?
If you enforce a coding error you should get it either in the event log or in the SharePoint ULS log (C:\Program Files\common files\microsoft shared\web server extensions\14\logs)
Can you verify the ULS log?
Can you verify using SharePoint Manager that the event receiver is attached to your library?

HTH
Rainer
0
 
BKennedy2008Author Commented:
Hi Rainer,
This is an added help from when you helped me out before..Much appreciated. I reset the Sharepoint Timer Service, reset IIS, and the file does not split into parts and populate the columns. I am not seeing any errors in the current log other than reached its limit...

Weirdest thing is I took an event receiver before that worked, that I no longer needed that was working with the above SAME code except different Column headers, changed them to match the new site, and it works. But if I try and add a new one with the same code, it does not trigger.
0
 
BKennedy2008Author Commented:
The event receiver is in SharePoint Manager (Both of them), but I only have 1 activated at a time while testing
0
 
BKennedy2008Author Commented:
Here are 3 images, 1st one is not working, the second is, and the 3rd is the site
NotWorking.gif
Working.gif
SharePoint.gif
0
 
BKennedy2008Author Commented:
Rainer, I am an idiot. When creating the Event Receiver, I did not select the correct event receiver type that I wanted...I selected Document library, and it worked like a champ.
Thanks again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.