Event handler getting fired on all list and libraries

I have created an event handler and add it to a custom content type. Some how this event handler is getting fired on each every list which are there inside a site. Below is my content type declaration with fields and event handler. This content type
is being activated using a featur scope at "Site".
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Document (0x0101) -->
<ContentType ID="0x01010069131024FE3C485FAEF6C36926B5FD67" Name="CIB Document" Group="CIB Content Types" Description="CIB Content Types" Inherits="FALSE" Version="0">
<FieldRefs>
<RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Hidden="TRUE" Name ="Title"></RemoveFieldRef>
<FieldRef Name="Metier"
ID="{F3ABF2F2-437B-4403-8A11-BEAE9F507009}"
DisplayName="Metier"
Sealed="TRUE"
Required="FALSE" />
<FieldRef Name="Department"
ID="{0B11D33C-B8D1-485F-A483-755BFE55C2B9}"
DisplayName="Department"
Sealed="TRUE"
Required="FALSE" />
<FieldRef Name="Owner"
ID="{FC6FE3D4-5EEE-4812-A77C-499AB9927D1A}"
DisplayName="Owner"
Sealed="TRUE"
Required="FALSE" />
<FieldRef Name="ExpiryDate"
ID="{D68E037B-63A2-42FF-8150-412972CB062F}"
DisplayName="Expiry Date"
Sealed="TRUE"
Required="FALSE" />
<FieldRef Name="SecurityStatus"
ID="{5954E9C2-921B-46FB-8A7B-2BC0F62BD011}"
DisplayName="Security Status"
Sealed="TRUE"
Required="FALSE" />
</FieldRefs>
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
<spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
<Receiver>
<Name>CIBDocumentHandlerItemAdding</Name>
<Type>ItemAdding</Type>
<Assembly>Common.SharePoint.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=68d03adf96d84a47</Assembly>
<Class>Common.SharePoint.Web.Handlers.CIBDocumentHandler</Class>
<SequenceNumber>10500</SequenceNumber>
</Receiver>
</spe:Receivers>
</XmlDocument>
</XmlDocuments>
</ContentType>
</Elements>

You need to add the ListTemplateId or ListUrl to the Receiver element,
E.g. If you had a list definition with the template ID 10500, then your event receiver XML would look like this:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListTemplateId="10500" >
<Receiver>
<Name>CIBDocumentHandlerItemAdding</Name>
<Type>ItemAdding</Type>
<Assembly>Common.SharePoint.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=68d03adf96d84a47</Assembly>
        <Class>Common.SharePoint.Web.Handlers.CIBDocumentHandler</Class>
<SequenceNumber>10500</SequenceNumber>
</Receiver>
</Receivers>
</Elements>
Regards, Matthew
MCPD | MCITP
My Blog
Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

Similar Messages

  • Please Help!! Lists and libraries suddenly blocked just before migrating from SharePoint 2007 to 2010

    Hi all,
    I took several weeks preparing the migration of a large farm from SharePoint 2007 to 2010 using the system of restore databases and mount site collections. I've built the new farm and I have done several full migration tests to verify that all was well the
    day of final migration.
    The farm consists of three virtual servers: one with SQL Server 2012 and two with SharePoint Server 2010. Upon completion of the tests we've moved the servers to another network. We have turned on the servers and everything seems to work fine.
    Just the day of the final migration I wanted to check the HealtReports list of the Central Administration, and when I wanted to look up an alert, the view window has not shown me anything and ribbon has appeared with all options grayed. Days ago worked fine.
    Alarmed by this, I have started to check all lists and libraries in the Central Administration and the same happens. I can not view or change the items, nor add. Neither I can change the properties of the lists or libraries, as if everything was locked. I
    tried on the main site collection and same thing happens, and I have tried with several user with Total Control permissions. I have also verified that the site collection was not in ReadOnly mode.
    I have restored a site collection from SharePoint 2007 and have migrated successfully to 2010. Before applying visual upgrade I found that the content is also locked. It is as if he had changed anything in the configuration of the whole farm, but I can not
    find what. The Event Viewer of the three server shows no errors related to this. The SharePoint LOGS not show anything unusual.
    I do not know where to look and urges me to find a solution because the old servers must be out of service soon. I accept any suggestions.
    Kind regards.

    Finally I answer myself because I've already found and fixed the problem. Before moving the servers in farm to the another network I've unplugged the single SharePoint server from the farm database for to clone it. Apparently
    this disconnection removes all the implemented solutions and the farm remains without servers. Reconnecting the servers not re-implements the solutions. When I was about to create a new farm I have seen that all solutions were not implemented,
    I have implemented one by one and the system worked again.
    If any of you happen reaches you, now you know what it may be due.
    Kind regards!! Now I'm a happy man! ;)

  • Content search web part to display only lists and libraries

    Hi,
    I want to configure Content Search Web Part to display only the names of lists and libraries inside my site collection. I tried adding Keyword filter "Only return lists and libraries", however it is also returning list items. Any idea on this issue?

    Hi John,
    Thanks.
    Agree with your point. I can't use any code (that is client requirement). Also, still I use, I can't use it in this scenario. I want to display most visited lists and libraries (in last month or lifetime). I can use managed properties such as ViewsLifeTime
    and ViewsRecent to sort it If i get the names of lists and libraries. Let me know if this clarifies the question more and you have an idea about it.

  • All the Event receivers getting fired in SharePoint 2010 Event receiver Solution

    Hi friend.
    I have two event receivers. both are deployed as Farm Solution with Site as scope.
    ER1=> This event receiver is attached to Form Library and I have changed it's URL in Element.xml ListUrl as Listurl="TimeLog/Forms"
    ER2=> This event receiver is attached to Custom list and I have changed its Url in Element.xml as ListUrl="Lists/MyList"
    Both the Event receiver have ItemUpdated Event
    Here TimeLog is name of Form Library where I log time and MyList is name of custom list.
    Event Receivers are deployed to my Root site but I have page to redirect to other site collection which are under root site which contains my list and library. (Note: I dont have any list and library on my root site)
    Http://myportal/
    and I have other site collections
    http://myportal/sites/A
    http://myportal/Sites/B and so on..
    When I activate both the Event Receiver feature in SiteCollection "A" and updates some value in myList both the event receiver get fired and logs are generate.
    Can some one help me out to get only relevant event receiver get fired.  
    Thanks & Regards
    Gireesh Painuly

    Thanks all for your response.
    I identified the problem but did not find any solution. I would like to elaborate my requirement in detail:
    1- My Site collection structure is as below
    a. http://SP13/  => my root site as team site
    b. http://SP13/Sites/Client1
    c. http://SP13/Sites/Client 2    ..... and so on.. with same URL pattern.  
    1- I have created a SharePoint 2014 Empty SharePoint solution as Farm solution ( Because I have multiple site collection in a web application which perform same operation but belong to different clients)
    2- I added two Event Receivers in in this solution name ER1 and ER2
    3- I created two features ER1-Feature and ER2-Feature these feature contain related ER1(ER1-Feature) and ER2(ER2-Feature) i.e one feature contains ER1 and another feature contains ER2. Both of these features have scope=Site because I don't have any list
    and library at Root site that's why scope has not set to Web level.
    4. I created two list ERList1 and ERList2 for respected ER's i.e ERList1 for ER1 and ERList2 for ER2
    5. Both ER1 and ER2 has two methods ie. Item was Added and Item was Updated. I have just written code in these methods to create a text file to check which event receiver get called. I am not updating any list or library in these event.
    6. While creating Event Receiver I have selected Custom List as the source for triggering Event. but I modified Element.xml file of both the Receiver as below:
       A. ListUrl="Lists/ERList1" => in ER1 for ERList1 List
       B. ListUrl="Lists/ERList1" => in ER2 for ERList2 List.
    7. I Deployed my Solution to my root site ie Http://SP13/
    8. Now when I go to http://SP13/Sites/Client1 and open the ErList1. after adding a record in this list.. I get two log files generated in my drive that is ER1Executed.txt and ER2Executed.txt ( These files are generated by code which I have written in my
    ItemAdded and ItemUpdated methods of both ER1 and ER2 respectively
    9. Same two files are generate if i add any itme in ERList2 as well.
    10. But I identified it by creating both of these list at my root site to check whether tow file get created or not. but here it works fine just creates respected file. it means on related event receiver get fir as it should.
    So conclusion: 
    when Event receiver is activated in http://SP13/Sites/Client1 it creates two files mens ER is not able to find the list url properly. because in child site collection url get changed
    http://SP13/sites/client1/Lists/Erlist1
    How can I fix the URL in Element.xml so that related Event Receiver gets fired. I have multipla project in same Url pattern so that solution is deployed as Farm.
    Thanks 
    Gireesh Painuly

  • SharePoint lists are not showing in SharePoint designer "Lists and Libraries" section

    Hi , 
    I using sharepoint 2010 and sharepoint designer 2010.
    I created a custom list on the sharepoint , and i trying to open the list through designer, but in sharepoint designer under the "Lists and Libraries" section that created custom list is not showing.
    But when i click on "AllFiles-->Lists -->MyCustomlist " (its present in the root folder's "Lists" folder)
    can anyone help on this.
    regards,
    RK

    Hi,
    According to your description, there is a list appears in “All Files” section but not in "Lists and Libraries" section in SharePoint Designer.
    What if you refresh(F5) the SharePoint Designer in the "Lists and Libraries" section? Will the issue list appears?
    If the list still doesn’t show up, please clear the cache of the SharePoint Designer and reconnect your site for a test.
    About how to clear the cache of SharePoint Designer:
    http://www.c-sharpcorner.com/UploadFile/sagarp/how-to-clear-your-sharepoint-designer-20102013-cache/
    Feel free to reply if there any progress.
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • See Also in SharePoint lists and libraries

    Kindly please help on how to disable the "See Also" inside lists and libraries
    Also, where is this getting files from ? Inside the list and libraries ??
    Thanks in advance!
    AJ MCTS: SP 2010 Configuration MCSA: Windows 7 If you find this post useful kindly please mark it as an answer :) TY

    If editing the masterpage isn't an option, active publishing features (if not a publishing template) and add that script to the Styles gallery with the !important parameter added on the end. It'll be applied locally to the whole site.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Can't see Lists and Libraries in SharePoint Designer 2010

    Hello,
    I'm moving Site Collections from one domain to another domain. I set up Development Farm and Production Farm in new domain.  I moved all site collections to Development Environment without any problem. However, I'm having a problem with one site collection
    in Production. When I restored site collection in Production, I cannot see Lists and Libraries in SP Designer.  On the other hand, when I restore same site collection in Development, I see Lists and Libraries in SP Designer.
    I have five servers in Production; 2wfe, 2app, and 1db.
    I have three servers in Development; 1wfe, 1app, and 1db.
    What could be the issue? It's frustrating!
    Thanks
    Orrin

    Hi,
    have you checked the Log for any error, there could be broken links and may be SPD is throwing some error which would be easier to isolate the issue.
    also see
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/a1804727-1191-4c41-b8c4-9e8299a2ad61/sharepoint-designer-unable-to-show-items?forum=sharepointcustomizationprevious
    and have you enabled SPD for you site and you have design permission
    Site Actions > Site Settings > Sharepoint Designer Settings > Enable Sharepoint Designer
    MCITP: SharePoint 2010 Administrator
    MCTS - MOSS 2007 Configuring, .NET 2.0
    | SharePoint Architect | Evangelist |
    http://www.sharepointdeveloper.in/
    http://ramakrishnaraja.blogspot.com/

  • How do i get my buy all button and see how much im spending on my itunes wish list

    how do i get my buy all button back and see how much im spending on my itunes wish list

    I cant find any of my recently bought songs or the apps i have purchased. When I was updating my ipod there was a button that asked about transfering purchases and I didnt read it, and I didnt update manually so i think thats why i lost everything. I clicked on the intrustions and clicked on apps and i coulnt find any of my old stuff.

  • Event handling to the drop down list in the WEB DYNPRO ALV.

    Hi Experts,
    I posted same thing in the UI programing in the morning
    For better Visiblity(as i didnt get any replies) of my issue i am posting the same thing in the ABAP General as well.
    In my dynpro ALV i have 5 fields. in that 2ed field has the drop down list.
    if i select any of from the list, based on the particular selected value, some value should be reflect in the 3rd field of the ALV.
    Ex:
    dropdown list of  2ed fields inclued like below
    AUXILIARY CONTROLLER
    AXLE ASSEMBLY, NON-OSCILLATING
    ACTUATOR, LINEAR
    AIR CONDITIONER
    BLADE, EARTHMOVING
    if i select ACTUATOR, LINEAR the value ( ACT - first three letters ) should automaticaly reflects in the 3rd field of the ALV like below
    Filed 2                Field 3
    ACTUATOR, LINEAR       ACT
    I thnk we have to do the some Event handling for that dropdown.
    I checkd in the SCN but i didnt find any solution to my issue.
    Any solutions/sample code is appriciated.
    Regards!

    Make sure that the Location Bar is not set to "Nothing": Tools > Options > Privacy > Location Bar: When using the location bar, suggest: History, Bookmarks, History and Bookmarks
    See [[Smart Location Bar]]

  • Event handling to the drop down list in the web dypro ALV.

    Hi Experts,
    In my dynpro ALV i have 5 fields. in that 2ed field has the drop down list.
    if i select any of from the list, based on the particular selected value, some value should be reflect in the 3rd field of the ALV.
    Ex:
    dropdown list of  2ed fields inclued like below
    AUXILIARY CONTROLLER
    AXLE ASSEMBLY, NON-OSCILLATING
    ACTUATOR, LINEAR
    AIR CONDITIONER
    BLADE, EARTHMOVING
    if i select ACTUATOR, LINEAR the value ( ACT - first three letters ) should automaticaly reflects in the 3rd field of the ALV like below
    Filed 2                Field 3
    ACTUATOR, LINEAR       ACT
    I thnk we have to do the some Event handling for that dropdown.
    I checkd in the SCN but i didnt find any solution to my issue.
    Any solutions/sample code is appriciated.
    For better visiblity( as i didn't get any replies ) I posted same thing in the ABAP Programing
    Regards!
    Edited by: Prasanth M on Feb 20, 2009 2:54 PM

    Make sure that the Location Bar is not set to "Nothing": Tools > Options > Privacy > Location Bar: When using the location bar, suggest: History, Bookmarks, History and Bookmarks
    See [[Smart Location Bar]]

  • Events not getting fired for templated controls.

    Hi,
    I have an asp.net custom server control, in which I have given template support. The template controls render fine. But, the events of template controls are not getting fired. For example, If I added an asp dropdownlist as a template in my custom control
    and select any item from dropdownlist and raised the postback, the selected item did not get updated in dropdownlist ( i.e selectedIndex, selectedText of the control remains the same as like initial rendering.), also I am not able to trigger the SelectedIndexChanged
    server side event of dropdownlist.
    I have used NamingContainer for rendering the template controls. The codes are as follows,
    <code>
    This is my source:
         private
    ITemplate fileTemplate =
    null;
     [TemplateContainer(typeof(ContentContainer)),
    PersistenceMode(PersistenceMode.InnerProperty),
    DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
    TemplateInstance(TemplateInstance.Single)]
    public ITemplate FileTemplate
    get
       return fileTemplate;
    set
    fileTemplate = value;
    public class
    ContentContainer :
    WebControl, INamingContainer
    internal ContentContainer()
    protected override
    void CreateChildControls()
    this.Controls.Clear();
    ContentContainer container =
    new ContentContainer();
    this.FileTemplate.InstantiateIn(container);
    this.Controls.Add(container);
    base.CreateChildControls();
          public
    override ControlCollection Controls
    get
    this.EnsureChildControls();
           return
    base.Controls;
    Whereas in my application, I have rendered the custom control with template as below,
    [ASPX]
    <mycustom control>
    <FileTemplate>
    <asp:DropDownList
    ID="ddc1"
    runat="server"
    AutoPostBack="true"
    OnSelectedIndexChanged="ddc1_SelectedIndexChanged"
    >
    <asp:ListItem
    Text="Item1"
    Value="one"></asp:ListItem>
    <asp:ListItem
    Text="Item2"
    Value="two"></asp:ListItem>
    <asp:ListItem
    Text="Item3"
    Value="three"></asp:ListItem>
    <asp:ListItem
    Text="Item4"
    Value="four"></asp:ListItem>
    </asp:DropDownList>
    </FileTemplate>
    </mycustom control>
    [Code Behind]
    This event is not getting raised.
    protected
    void ddc1_SelectedIndexChanged(object sender,
    EventArgs e)
     I can get the template control's details here using "FindControl("templateID")". But not able to get the updated details.
    protected void btn_Click1(object sender,
    EventArgs e)
    var template= this.CustomControl.Controls[0].FindControl("ddc1");
    </code>
    Where I am going wrong? Kindly help me on this.
    Thanks in advance.
    Regards,
    Meena

    This is a Windows Phone forum, not a web development forum. Please ask this question at the forums at
    http://asp.net.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • How to get rid of  Reading List and why my add page going in there?

    My + on the toolbar is now adding pages to the reading list instead of the bookmark.. How do i change that/get rid off reading list? I want stuff to go to bookmark. I tried to change the setting in  in Safari>Preferences>Bookmark but I dont have a bookmark option.. Very annoying. I updated to 10.9.1 version. Help!

    Click and hold the button to add a bookmark.

  • Getting StorageManagementInformation using Lists and Libraries

    Good morning,
    I am using SPSite.StorageManagementInformation to get the size used for my sites. The idea I have is calling this method twice with an accurate number on the limits due to the bad performance this method have (the first call will be run
    with SPSite.StorageManagementInformationType.DocumentLibrary and the second one with SPSite.StorageManagementInformationType.DocumentLibrarySPSite.StorageManagementInformationType.List).
    Now my question is: what is a list and what is a library? I have run these two methods with a high value for testing and, for example, for Document Libraries I get the next template Ids: 101, 113,114,116,121,122,123 and 851.
    I would like to query every list in my SPSite and increase the counter depending on if it is a List or a Library (screenshots attached).
    Thanks in advance

    Hi,
    If you want to know how to check if ListTemplateType is list or library, the following code snippet for your reference:
    using (SPSite site = new SPSite("http://sp2013sps:8080"))
    SPWeb web = site.OpenWeb();
    int libsCount = 0;
    int listsCount = 0;
    foreach (SPList list in web.Lists)
    if (list.BaseType == SPBaseType.DocumentLibrary)
    libsCount++;
    else
    listsCount++;
    Console.WriteLine(libsCount+"|"+listsCount);
    Console.ReadKey();
    Best Regards,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • PlEASE HELP EASY QUESTION: unload event is not firing at all.

    Hi, onUnload event is not firing in Safari browser. I tried with different ways to capture that event but i failed to capture that event. So please help me on this, give suggestions to capture that event. Or any other event is firing when window is closing. Actually, i need to execute when window is closing. But in Safari the window is closing without firing of any events.

    Safari doesn't execute the unLoad action when closing windows, period!
    It only executes it when loading another page.
    I might be wrong but I think Safari doesn't allow you to close a window with Javascript at all. All close events are blocked.
    Maybe a SWF file can do it somehow. But I'm not sure...

  • What is difference between SharePoint List and Libraries

    What is difference between SharePoint List and Libraries

    Hello,
    You also might want to loot at here:
    http://veroniquepalmer.com/2013/02/24/the-difference-between-sharepoint-2010-lists-libraries-and-pages/
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/1d4152cd-92a6-4eed-9a52-a519ec71c674/what-is-the-difference-between-document-library-and-list-in-sharepoint
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for