All DocumentSet derived ContentTypes' EventHandlers fires when uploading document

I have made a custom "base" content type based on the Document Set content type. On this content type I attach 6 EventHandlers:
<ContentType ID="0x0120D5200088cd8a49c45a45dbb0b808d0934cd901"
Name="My Magical Base Document Set"
Description="My Base Document Set"
Group="Magical Content Types"
ProgId="SharePoint.DocumentSet"
PushDownChangedResourceFilesOnly="TRUE"
Version="0">
<FieldRefs />
<Folder TargetName="_cts/MyDocSetCustom" />
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
<Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
<Receiver>
<Name>MagicalBaseDocumentEventHandlerItemAdding</Name>
<Type>1</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>MyMagicalProject.EventHandlers.MagicalBaseDocumentEventHandler</Class>
<SequenceNumber>50</SequenceNumber>
</Receiver>
<Receiver>
<Name>MagicalBaseDocumentEventHandlerItemUpdating</Name>
<Type>2</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>MyMagicalProject.EventHandlers.MagicalBaseDocumentEventHandler</Class>
<SequenceNumber>50</SequenceNumber>
</Receiver>
<Receiver>
<Name>MagicalBaseDocumentEventHandlerItemDeleting</Name>
<Type>3</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>MyMagicalProject.EventHandlers.MagicalBaseDocumentEventHandler</Class>
<SequenceNumber>50</SequenceNumber>
</Receiver>
<Receiver>
<Name>MagicalBaseDocumentEventHandlerItemAdded</Name>
<Type>10001</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>MyMagicalProject.EventHandlers.MagicalBaseDocumentEventHandler</Class>
<SequenceNumber>50</SequenceNumber>
</Receiver>
<Receiver>
<Name>MagicalBaseDocumentEventHandlerItemUpdated</Name>
<Type>10002</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>MyMagicalProject.EventHandlers.MagicalBaseDocumentEventHandler</Class>
<SequenceNumber>50</SequenceNumber>
</Receiver>
<Receiver>
<Name>MagicalBaseDocumentEventHandlerItemDeleted</Name>
<Type>10003</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>MyMagicalProject.EventHandlers.MagicalBaseDocumentEventHandler</Class>
<SequenceNumber>50</SequenceNumber>
</Receiver>
</Receivers>
</XmlDocument>
</XmlDocuments>
</ContentType>
I then create 24 new content types based off of the above content type and I bind them to a document library.
After deployment, when the content types are all created and the library is created and have all the content types binded, I create a new document set in this library. I then try to add a new item (document).
This is where the interesting thing happens. When I add a Word or Excel document none of the EventHandlers are fired. But when I add a PDF, TXT, or XML document then the ItemAdding EventHandler is fired, 24 times - meaning the ItemAdding EventHandler is
fired for each DocumentSet content type binded to the list, before finally giving the uploaded document the content type "Document".
The document library gets created by a ListInstance on deployment, and all the content types are being binded in this ListInstance.
Is this a bug? Or have I done something wrong?

Hi,
I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
Thanks 
Patrick Liang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Patrick Liang
TechNet Community Support

Similar Messages

  • Access Denied when uploading documents

    Hi, 
    An end user who has design permission on a particular site gets access denied page when user clicks on "OK" in upload document dialog box.
    but document is uploaded and is checked-out.
    We checked features, permission they are all same on the all the sites(with issue or without  this issue)
    Regards,
    AnkitG

    Hi Ankit,
    Based on your description, it seems that you have add item permission but no edit item permission on the library.
    I recommend to go to the library permission of the library with issue and then click Check Permissions in the ribbon to check the permission for your account.
    If that is the case, then grant the necessary permission to the user on the library or click Delete unique permissions in the ribbon to inherit the permission from the site.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • I keep getting an error when uploading documents

    I keep getting an error when uploading pages, keynote, or word documents into icloud.com. It won't tell me what type or error and it acts like it loads and gets all the way to the end of the bar and then says "error please try again." Please help!

    Have you tried a different web browser when submitting your proof of eligibility?

  • Word cannot open file when uploaded document to document library progrmmatically.

    I have created one button in which I am uploading a new document to document library through my code. The document library contains document template.
    My code is as below:
    private SPListItem CreateDocument(SPList Docs, string title)
    SPListItem newItem = null;
    try
    SPFolder cmsDocsFolder = Docs.RootFolder;
    SPFileCollection fileCollection = cmsDocsFolder.Files;
    if (!string.IsNullOrEmpty(Docs.ContentTypes[0].DocumentTemplateUrl))
    string docTemplateUrl = Docs.ContentTypes[0].DocumentTemplateUrl;
    SPFile docTemplateFile = Docs.ParentWeb.GetFile(docTemplateUrl);
    byte[] binaryFile = docTemplateFile.OpenBinary();
    string newFileUrl = cmsDocsFolder.Url + "/" + RemoveSpecialCharacters(title).Trim() + _docxExt;
    if (!Docs.ParentWeb.GetFile(newFileUrl).Exists)
    SPContentType contentType= Docs.ContentTypes.Cast<SPContentType>().FirstOrDefault(c => c.Id.IsChildOf(ContentTypeIDs.CMSDocument));
    if (contentType != null)
    SPFile addedFile = fileCollection.Add(newFileUrl, binaryFile, false);
    newItem = addedFile.Item;
    newItem[FieldNames.ContentTypeId] = ContentTypeIDs.CMSDocument;
    newItem[FieldNames.ContentType] = contentType.Name;
    catch (Exception ex)
    return newItem;
    My code does not throw any error but when I go to document library and click on uploaded document the file tries to open in word application but I am getting an error:
    "Word cannot open the file because the file format does not match the file extension. (url)"
    The browser I am using is FF.
    What am I missing? Please help.

    Hi,
    Please try to upload your document using SharePoint UI.
    If the issue still exists in Firefox, I suggest you check your Firefox settings.
    If not, please debug your code and watch the value or here is a blog for your reference:
    http://thearkfloats.blogspot.com/2013/10/programmatically-upload-to-sharepoint.html
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Assign status profile automatically when upload documents in cFolder

    Hello all,
    Is there any way to make the automatic assignment of a state profile to documents that are upload into a collaboration of cFolder?
    At this time we do it manually, but carries to assign the state profile every time we upload a new document.
    Best Regards,
    Jennifer Lohan.

    Hi
    Use FM CFX_API_STATUS_PROFILE_ASSIGN somewhere in any user exit or BADI (let me know the scenario)
    we pass status profile GUID and the Folder / Doc /collaboration GUID into the FM and it attaches the status profile to desired object.
    regards
    Alok

  • Approval templates don't fire when updating document

    I'm running trials in my test database and it appears that approval templates only work on new added documents?  SAP Business One version 8.82  I am testing a query that calculates certain criteria against the business partner's credit limit.  If there is a deviation I want the approval process to start.
    Everything works fine when I add a new sales order with a doctotal that deviates from my credit limit logic.  Approvals fire off and the user has to wait for the manager to approve.  However if I add a sales order with zero value and then go back in and update the pricing later the approval never triggers.  So users are just able to go around approvals by adding blank documents first and then updating them however they see fit.
    Am I doing something wrong or is this just how SAP B1 approvals function?  Do approval templates have any impact on updated documents?

    Do TN's throw the red bar erros at the bottom of the client's GUI?  The ones that look like this...
    I'm looking through the following documentation...
    http://scn.sap.com/docs/DOC-7034
    and I can't seem to confirm what returning @error = 1 will actually cause.

  • ICloud crashes when uploading documents.

    I've been wrking on something in Pages and wanted to carry on with it on my iPhone when I'm out, so I opened iCloud in Safari, entered iWork and uploaded the document. The upload bar appeared for a brief second, then the page crashed. When it reloaded, I got an "unexpected" error massage with an option to send a report.
    When I tried once more, I simply restarted iWork right after I clicked Upload.

    Hey swibowo,
    Welcome to the BlackBerry® Support Community Forums.
    To better assist you can you provide a screen shot of of what you are seeing in BlackBerry Link when the BlackBerry Q10 smartphone is connected? If this is possible please blank out any personal information that may be displayed in the image.
    Thank you.
    -HB
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Problem when upload legacy data

    Hi all,
    I've faced a problem when uploading asset legacy data (AS91) for customer. My customer have started depreciation on May 21, 2009, and I set transfer date is November 30, 2010. So SAP doesn't calculate right planned value for December, 2010. I think that problem related to the first month depreciation. It calculated full month for depreciation (instead of from May 21) and change the planned value for December 2010. So I want SAP just calculate 11 days depreciation for May 2009. How can I config to do this?
    Thanks in advance!

    Hi,
    Check in the asset master Opening Start Date for depreciation.. If it is under open mode change that date and see asset explorer for depreciation values.
    Thanks,
    Padmaja

  • Disable "Overwrite existing files" when upload doument

    Dear team,
    in document library, when upload document, i don't want the document to overwrite the documents with the same name.
    there is chekbox in upload page, that is default checked, I searched and some people said that I can update the upload page, find the checkbox control, and set the value to false, so i update the value in Upload.aspx and Uploadex.aspx page to change the
    value.
     but after changing the value, I cannnot open the upload page successfully, it always shows error.
    Did I do anything wrong?

    Hi Greetings.
    This is not the right procedure
    Scording to your post, my understanding is that you wanted to override SharePoint OOTB Upload.aspx default for " Overwrite existing files" checkbox.
    We can use the AdditionalPageHead delegate control to change the default without modifying upload.aspx.
    There is an article for your reference, although it is about the WSS3.0, it still works for SharePoint 2013: Turn Default Upload Overwrite Off in WSS 3.0
    Please follow the steps as below:
    Download the solution file form here
    Copy the wps file to the Disk C.
    Open the SharePoint 2013 Management Shell.
    Run the command: add-spsolution c:\ DefaultUploadOverwriteOff.wsp
    Open the Center Administration, click System Setting->Manage Farm Solution-> dp.sharepoint.workflow.wsp->Deploy to one or more Web Application.
    Open the site, clilck Site settings-> Site collection features-> Default Upload Overwrite Off->Active.
    Open the library, the 'overwrite existing files' checkbox will be unchecked.
    Source Link http://social.technet.microsoft.com/Forums/office/en-US/0a94c70b-20e5-4cee-93e2-fbaf50a9ac07/removing-the-overwrite-existing-files-checkbox-which-appears-when-uploading-a-new-document-in?forum=sharepointgeneral
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Workflow in document library doesn't function properly on uploaded documents

    I have a document library with a few different content types. When documents are added to the library either via new or upload I want to run a workflow that numbers the documents (so contracts have a contract number & change orders have an order number).
    The counters are in a separate list - one item for each counter, a last number and a calculated next number.
    So for contract numbers the workflow gets the nextnumber for the counter and enters it into the contract number field of the current item before sending it back to the counter as last number. 
    The workflow is set to start on item creation and works just fine with new documents. However, it doesn't work on uploaded documents. In order to discern between the different content types I've set a field condition to recognize if the workflow should run.
    When uploading documents the workflow runs before the field is set and therefore doesn't set the contract number. 
    I tried just setting a 5 min "wait" at the start of the workflow, but then the document fails to save. 
    Workflow:
    Sorry it's in Norwegian, I can't figure out how to get the conditions and actions into English (all my buttons etc are in English)...
    Any ideas on how to get the workflow to run properly in order to update the contract number?

    Hi,
    According to your post, my understanding is that you had a workflow in document library didn’t work properly.
    I hadcreated a list called Counter1, created a library called
    New&Upload, modified the view of the list, made it display the
    ID of the list.
    I created a simple workflow as below, selected “Start workflow automatically when an item is created”, it worked well without any issue no matter
    Upload or New a document.
    You can create a new workflow with a new library, then check whether it works.
    You can also check the event log and ULS log to see if anything unexpected occurred.
    To check event log, click the Start button and type “Event Viewer” in the Search box.
    For SharePoint 2013, by default, ULS log is at      
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS
    You can check the ULS log by the methods here:
    http://blogs.msdn.com/b/opal/archive/2009/12/22/uls-viewer-for-sharepoint-2010-troubleshooting.aspx
    http://msdn.microsoft.com/en-us/library/gg193966(v=office.14).aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Upload documents

    Greetings all,
    I have a problem when uploading document, images, etc... into an application(I am using JAVA, JSP,JSF and JS in my application).
    It is working fine by using Weblogic 8.1. However, when I am using Weblogic 10.3 it gives me ERROR 500--Internal Server Error.
    Even though the code is the same except the deployment files which are one for weblogic 8.1 and the other one for weblogic 10.3.
    I don't know if there is something I should add or do to make it run properly.
    Regards,

    hi
    please do refer to this weblog it answer your scenario .please do not forget to give points
    Restricting The Size Of The File To Be Upload in CM Repository
    with regards
    subrato kundu

  • Virus Found error message while uploading document in Document Library

    Hi,
    When uploading documents into the document library, I got a message "Virus Found" ERROR message.
    the installed  virus scanner is urrently unavailable.If the  problem persists, please contact your administrator.  
    How to resolve this issue? its in staging environment. in our test environment  we  never received this error message while uploading the message.
    help is appreciated.

    hi
    have you installed an antivirus app on server?
    Check this link
    https://support.microsoft.com/en-us/kb/2953311/
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • When uploading pictures from my iPad to my PC it wants to upload 8117 pictures but I have 8052 on my iPad will clicking erase after upload delete all my pictures including the pictures that are not included in the u

    When uploading pictures from my iPad to my PC it wants to upload 8117 pictures but I have 8052 on my iPad will clicking erase after upload delete all my pictures including the pictures that are not included in the upload

    Sorry mixed my numbers up I was in such a hurry to post the question uploading 8052 but I have 8117

  • Using DW CS6; when uploading a site DW changes all dates to today; how can I upload without changing the file-dates?

    Using DW CS6; when uploading a site DW changes all dates to today;
    how can I upload the site whilst preserving existing file-dates?
    Thanks
    Paul

    How are you uploading?
    I do not see this behavior in DWCS4 or DWCC (I assume nothing changed in DWCS6 and then back for DWCC, but I could be wrong).
    However, when I upload, I only select the files I have modified after an initial "Upload Entire Site? Yes/No" prompt. If you aren't selecting specific files to upload, and you're overwriting the files on your server with new copies of your entire local site each time, the mod dates would show as the date/time of your upload.
    To select only the files that have changed since your last upload...
    1. Right click on your local root folder in the Files window under Local View
    2. Go to Select > Newer Local from the context menu
    3. Wait until DW is done talking to the server, it could take a while, when it's done, all of the files that have a newer mod date locally than their server counterparts will be selected
    4. Click the Put (up arrow) button
    For me, this process never changes the dates of files that aren't part of the upload.

  • When uploading my email account it also uploaded over 6,000 emails that are on the aol server from over the years, how can I delete all but recent ones?

    when uploading my email account it also uploaded over 6,000 emails that are on the aol server from over the years, how can I delete all but recent ones?

    Unfortunately, there is no easy way.  Delete just as you would any other message that you don't want.  It's probably just as well that there is no universal deletion capability.  I can see many of us committing a major "oops."

Maybe you are looking for

  • How to create multiple linked forms

    I'm new to SharePoint. But have coding background so I'm confident I can accomplish what' I've taken up. But I need little guidance to make sure I going in right direction. We've hundreds of project which run in parallel. Some projects are for new cl

  • After a search page renders, the NEW FF does NOT open up a choice in a new window and you lose the search page. WHY? I do not like this!

    every internet browser keeps the main page that renders when you do a search. you can click on any of the options and a new window opens. the latest version of FF i downloaded today has completely removed that feature. when you click on a search choi

  • APP-FND-01388, Quickpay failed

    Hello, Quickpay failed with the following error APP-FND-01388: Cannot read value for profile option HR:Execute_Leg_Formula in routine &ROUTINE. HR_6882_HRPROC_ASSERT LOCATION py3vntsetup:2 APP-PAY-06882: Assertion failure detected at location py3vnts

  • Vendor account not associated?

    I originally installed ADE and and authorized use without a vendor account or Adobe ID.  I had to perform system restore on my laptop and ADE was removed for some reason so I had to reinstall it.  This caused me to have to create and Adobe ID.  So I

  • LOV in Report limited by :APP_USER

    I have a LOV in a tabular form. The LOV is built with this sql query: select first_name||' '||last_name, id from master where ent_type in (select id from ent_type where trim(upper(description)) like '%STAFF%') and trim(upper(auth_name)) = :APP_USER;