Event Receier to Save Document Library History in Custom List

Hi All,
        I have the document library which holds an excel document .And my client team will  update the excel document, such as making "check-in,check-out,editing the excel-sheet etc..) .
     And my client wants to store the below info of this document library in a seperate custom list
           *User who made check-in & Check-out with date and time
           *User who created the versions for the document with date and time  
Can any one help me how can i do this
Samar

There are multiple way to accomplish this.
1. Write event receivers on update and query the version history to update the new list.
2. Create job/scheduler which runs for every n minutes to update the version history to new list.
Bala

Similar Messages

  • Creating a document library with a custom template

    What I want is basically a good solution for people to be able to fill out a form on the web and then save it in the online library.
    You need to be able to automatically create a document from a template in just one or two clicks from the page and then automatically save it to the online-library.
    When this is done, the admin of the site will get a notification (this i think i know how to fix thought) so he can examine the new document instantly.
    How can this be done?

    That's more or less out of the box behaviour. Create a content type on a list or library depending on what your template is (word doc, InfoPath form, list item with styling etc.), then create an alert for your admin on the list.
    Your users can then create new items and save them in the list/library. The process is simpler with list items or InfoPath forms as they don't give you the wide choice of actions that you get in word docs etc..

  • How to find out if file contents under some document library SPListItem has changed

    hi,
    I am building a Sync tool which will Sync SharePoint document library to some other service(e.g. FTP). I have added event handlers on the document library for ItemAdded, ItemUpdated etc.. etc.
    Now i have one problem, when ever a file is updated (either custom properties and/or file content) then there is no way to check if its updating of content or custom fields. So everytime i need to upload my file to that FTP location. I want to get some indication
    that this time file content is updated not the custom fields, or file content with custom fields are updated.
    I have checked After and Before properties but its of no use. When ever you rename a file or just open the edit dialogbox and save it without updating any thing, all after and before properties are same :(
    Need some solution for this, any help suggestion is appriciated.
    Syed Shoaib Adil Senior SharePoint Developer Boston, Ma, USA

    Sorry for late reply.
    1st link (storing file hash/MD5) is not a solution for me as i have many Office documents
    2nd link doesnt have nay answers
    Archive Folder is not a solution. How can i find if current item SPFile has content changes?
    I already have my custom fields with each SPListItem. How can i find in itemUpdating/ed that if file content is changed? to make my custom field ture?
    Syed Shoaib Adil Senior SharePoint Developer Boston, Ma, USA

  • Authentication prompt issue when opening an office file in a document library with read permission for domain users

    An user as part of the domain users tries to open an office file from a document library but he got an authentication prompt asking him to authenticate. Domain users has only access to this library and not to the whole site. This uses to work in SharePoint
    2007 without any problem but not in SharePoint 2013, we didn't have a workflow on SP2007.
    Domain users has read access to only this document library in the site, but he shouldn't get an authentication prompt since he is part of the domain users and he is not trying to modify the document, he can open the document but gets two prompts, he can't
    also see the list using explorer view since nothings appears using the explorer view.
    Now, when opening the file, we can see..Updating Workflow Status, but we don't have any workflow working on this site or library, event any feature related to workflow.
    If we go to the event viewer in the server, we find this information,
    I also checked this thread but I couldn't find this scenario.
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/91bc770b-bb70-4885-a4ad-a243edb88753/event-id-8026-workflow-soap-getworkflowdataforitem-failed-doc-library-no-workflow?forum=sharepointgeneralprevious
    I also created another list with the same permissions and using other office files but got the same behavior.
    Now, we have migrated this site from SP2007 to SP2013.
    Any ideas?

    OK, I am going to throw out a lot of ideas here so hopefully they get you closer to a diagnosis. Hang on :)
    Does it happen to work for some users but not others? If so, try logging in on the "good" computer with the "bad" username. This will tell you if the problem is related to the end-user's system. Also, once the user downloads a document
    successfully can they open and work on it in Word? Also, does the document library have any custom content types associated with it or does it just use 'Document'?
    I notice that there are other folks on the web that have run into this same problem and the similarity seems to be that they are either on SharePoint 2007 or have upgraded from 2007. Did this doc library start out as a 2007 library?
    What you might want to do is this: Make a site collection from scratch in 2013 (or find one that you know was created in 2013). Choose team site (or whatever you want) for the root web and set up the security the same way you have it on the malfunctioning
    library. Now, use windows explorer to copy and paste some of the documents to the new location. Be sure you recreate any needed content types. Now test it from the troubled user's computer.
    I'm thinking there may be something that is different about the library since it was migrated through various versions and updates since 2007. I've sometimes found that there can be problems (especially with user profiles but that's a different story) with
    things that go through this evolution.

  • Restricting user access based on a site column value in a document library.

     
    We have a business requirement to show the contents of a document library based on a value (or values) in the site column (or multiple columns). For example, my document library has a custom site column called confidentiality. This
    will have values like restricted, internal and public. Now, based on the AD Group the user belongs to, I should be able to control the access to Restricted or Restricted and Internal files from the document library. We are using SharePoint Online 2010.
    Please suggest the best way to achieve this requirement?

    SharePoint's security model doesn't allow you to specify security based on metadata. You could however create a Sandboxed Solution containing a Feature that registers a custom event receiver on the Document Library. The logic inside this
    Event Receiver would fire after editing item properties (ItemUpdated) to apply item-level permissions based on the rules you need.
    Make sure to read the article below to determine if fine-grained permissions are suitable in your case:
    http://technet.microsoft.com/en-us/library/gg128955.aspx

  • Re-attaching old workflow to document library

    Hello,
    I've recently switched my sharepoint site to a new work environment (different DNS), but my custom workflows that were associated to my document libraries are no longer "attached" anymore. They still exist in the site itself, but they can not be
    associated to any list or library. Unfortunately, they are not reusable workflows due to having specific content that related to each library and their columns, so that option is out the window. Is there a way to reattach them to a library/list if the workflow
    is already created? Any help would be great.
    Thanks!

    Hi,
    According to your post, my understanding is that you wanted to re-attaching old workflow to document library.
    To migrate list while keeping workflow associations, you can save a site as a template and "include content”.
    Here is a similar thread for your reference:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/e8f6aef7-008e-4cf1-811b-11358922cbe4/migrate-list-while-keeping-workflow-historyassociations?forum=sharepointgeneralprevious
    In addition, you can migrate workflows between test SharePoint 2010 farms and production farms, in particular with workflows attached to lists.
    For more information, please refer to:
    HOWTO Move or Migrate SharePoint 2010 List-based Workflows between Sites and Site Collections
    Solved: Moving SharePoint 2010 Designer Workflows between Sites
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to create custom workflow for document library?

    Hi All,
    I have a document library with a custom  people picker column "assign to". Need to create approval workflow using designer, approval must send to person who is selected in "assign to" column. I tried with designer workflow,But finally
    facing "The e-mail message cannot be sent. Make sure the e-mail has a valid recipient". How to fix and achieve my scenario? Thanks in advance!

    I would suggest you to firstly print the assign to value using "Log to history" action. Moslty it could be of three reasons,
    1. Assign to value is not getting populated correctly in your SPD workflow
    2. Email server is not configured properly, If alerts and other emails are workfing in your server then this would not be a reason for issue
    3. The user your trying to send an email does not have valid email
    do let us know if can get the user email in your workflow.
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if the reply helps you

  • Display notification when a document is uploaded to document library on Homepage

    How can i display notification on homepage when a document is uploaded to document library in SharePoint 2013.

    Hi,
    I think this will work for your requirement.(I am assuming Notification should be visible to all the users).
    1. Create 1 Custom List (say "Notifications").
    2. Add Event Receiver on your document Library and Whenever a new document is uploaded by using Event Receiver update the same in "Notifications" List.
    3. By using ECMA Script ,you can read the List Items and bind .
    (or)
    you can achieve the same from the document library it selft , why list is for future enhancements.
    Please share your views.
    Don't forget to mark it as an Answer if it resolves your issue and Vote Me as helpful if it useful.
    Mahesh

  • Error while programmatically adding a document to SharePoint document library

    Hello everyone,
    I have created a custom content type and modified the document template to use the quick parts inside the template.
    I have a document library which uses the custom content type. 
    I have a button inside a custom application page(created using visual studio). On click of this button I want to create a new document inside the document library using the custom content type and update other columns in the content type. I am able to create
    the document, but I get the below error when I open the document.
    public static void UpdateAndCreateFile(SPWeb web)
    try
    web.AllowUnsafeUpdates = true;
    string sList = "My Document Library";
    string sContentType = "My Custom Document";
    SPList list = web.Lists[sList];
    // this always uses root folder
    SPFolder folder = web.Folders[sList];
    SPFileCollection fcol = folder.Files;
    // find the template url and open
    string sTemplate =
    list.ContentTypes[sContentType].DocumentTemplateUrl;
    SPFile spf = web.GetFile(sTemplate);
    byte[] binFile = spf.OpenBinary();
    // Url for file to be created
    string destFile = fcol.Folder.Url + "/" + "test2.docx";
    // create the document and get SPFile/SPItem for
    // new document
    SPFile addedFile = fcol.Add(destFile, binFile, true);
    SPItem newItem = addedFile.Item;
    newItem["ContentType"] = sContentType;
    newItem.Update();
    addedFile.Update();
    web.AllowUnsafeUpdates = false;
    catch (Exception ex)
    // handle exception here
    The above code gives the same issue when I use the 'Document' content type instead of the "My Custom Document" content type. 
    The document looks/opens fine when I create it from the browser.
    Please let me know if you have any suggestions. Thanks.

    I could not figure out a proper solution, but here is what I did to get around the issue.
    I created a document using the document template and saved it to the library(same doc library) and named it as Sample.docx
    In my code, every time I had to create a document, I would just copy the Sample.docx file to the library, but make sure I rename the file when I copy it.
    Then I can use the url of the file I saved through my code and get the list item and update the other properties/columns of the content type
    Below is the code to use an existing file and create a new file
    public static void UpdateAndCreateFile(SPWeb web)
    try
    web.AllowUnsafeUpdates = true;
    string sList = "My Documents";
    SPList list = web.Lists[sList];
    // this always uses root folder
    SPFolder folder = web.Folders[sList];
    SPFileCollection fcol = folder.Files;
    SPFile file = fcol[sList + "/Sample.docx"] ;
    file.CopyTo(sList + "/" + "test1.docx", true);
    web.AllowUnsafeUpdates = false;
    catch (Exception ex)
    Thanks.

  • Adding hyperlink in Infopath custom list which opens pdf document available in document library

    Hi,
    I have a custom list(modified in InfoPath 2010) and a document library having 2 pdf documents.
    In the Custom list, i have used the attachment option for another field.
    How to create a link in the InfoPath list, which when clicked opens the corresponding pdf from the document library?
    How to achieve this?
    Thank you

    Hi Venkatzeus,
    From your description, you have a list and attachments for the list are uploaded to a document library. To display the hyperlink in InfoPath form, you can directly use 2 Hyperlink controls. And give the document' URL in this control using formula.
    I’m not sure how you upload the list item attachments to another document library. But make sure you have made a connection between the list item and attachments in document library. Here is an example.
    ListTitle         ID
    Item1     1
    Item2     2
    Pass the ID to the document library when we create the attachment.
    Document Name             ItemID
    attachment1 for item1    1
    attachment2 for item1    1
    attachment3 for item2    2
    attachment4 for item1    1
    attachment5 for item2    2
    So here, we can see attachment1, attachment2, attachment4 are item1’s attachments and attachment3, attachment5 are item2’s attachments, because of ItemID.
    1. Create a new column for document library, named it DocumentURL.
    2. Create a workflow and set to start when new item is created automatically with following action.
    Set DocumentURL = http://server/topsite[%Current Item:URL Path%].
    3. Custom list form.
        1) Add a data connection to receiver data from document library.
        2) Insert document library connection as repeating section.
        3) Add a hyperlink control within the repeating section (Insert > Hyperlink).
        4) Select DocumentURL as the data source for Link To and Display options.
    4. Add a formatting rule to the repeating section control.
    If ItemID in document data connection is not equal to ID in Main data connection, then hide this control.
    5. Done.
    Let me know if you have any question.
    Thanks & Regards,
    Emir
    Emir Liu
    TechNet Community Support

  • Corrupt document gets created in document library with document template using createlistitem workflowaction in visual studio workflow for office 365 solution

    Hi,
    My requirement is to create a document library associated to a custom content type with a document template associated. Also I need to create a document based on the template in this document library when a new item is created in another list by taking the
    reference ID of that new Item , I need to create the document with the name appended by ID. I need to do all this deployment using WSP.
    I have created document library with document template associated to content type by following instructions in below stated blog :http://blogs.msdn.com/b/chaks/archive/2011/05/19/deploying-a-document-template-file-in-content-type-in-a-office365-sandboxed-solution.aspx
    This works perfect for me.
    However, there are few observations, when going to Document Library > Library Settings > Advanced Settings > Document Template section - doesnt shows the Edit template link. When tried to look at the value for the document template using view source
    , it is giving me /Lists/MyDocsListInstance/Forms/template.dotx instead of the actual template file uploaded.
    Ignoring the above observation, when I am trying to create a sandbox based workflow in visual studio to create document in document library when new item is created in another list, I provide the ContentTypeID as the ID associated with the document library
    with template. 
    It creates the corrupt document at end of workflow. 
    I have tried using .docx instead of .dotx files for workflow as per solution provided in some of the post but it isnt resolving my issue.
    Any help is much appreciated.
    Regards,
    Krutika

    OK, I am going to throw out a lot of ideas here so hopefully they get you closer to a diagnosis. Hang on :)
    Does it happen to work for some users but not others? If so, try logging in on the "good" computer with the "bad" username. This will tell you if the problem is related to the end-user's system. Also, once the user downloads a document
    successfully can they open and work on it in Word? Also, does the document library have any custom content types associated with it or does it just use 'Document'?
    I notice that there are other folks on the web that have run into this same problem and the similarity seems to be that they are either on SharePoint 2007 or have upgraded from 2007. Did this doc library start out as a 2007 library?
    What you might want to do is this: Make a site collection from scratch in 2013 (or find one that you know was created in 2013). Choose team site (or whatever you want) for the root web and set up the security the same way you have it on the malfunctioning
    library. Now, use windows explorer to copy and paste some of the documents to the new location. Be sure you recreate any needed content types. Now test it from the troubled user's computer.
    I'm thinking there may be something that is different about the library since it was migrated through various versions and updates since 2007. I've sometimes found that there can be problems (especially with user profiles but that's a different story) with
    things that go through this evolution.

  • Set relation between list and document library?

    I have a requirement that I want to show pop up/ modal dialog when I click on list item column "upload/Edit" (in EditForm.aspx) . In Modal Dialog I have to show upload button and also existed items if any. Here the attachments will store into document
    library's folder .The list item ID should be the folder name in document library.
    How do I set relation between list and doc lib ?
    Appreciate if suggests any links.
    Thank you.

    Hi Saurav,
    pls check below
    What version of SharePoint 2010 "SP 2010 Foundation or SP 2010 Server" you need to have SP 2010 server and to have the "User Profile service application".
    How do you configure the "User Profile service application" did you add the "Social Tagging Database"
    Create, edit, or delete a User Profile service application (SharePoint Server 2010)" 
    http://technet.microsoft.com/en-us/library/ee721052.aspx
    When you access to "Application Management>Manage service applications>User Profile Service Application>Manage User Permissions" validate if the all authenticated users Group have the "use Social Features" checked.
    Also validate in Central Administration in Farm Features if you have social tags and notes activated.
    http://sharepoint.stackexchange.com/questions/17546/tagging-feature-not-working
    https://social.technet.microsoft.com/Forums/office/en-US/c11cda96-091b-4b96-91bc-ccd8000238f4/tags-and-notes-sharepoint-2010-not-visible?forum=sharepointadminprevious
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • SharePoint 2013 users only see custom list and document lists that they uniquely created

    In my first SharePoint 2013 project, I want to create a view where users can only see their own files that they generated. I think I know how to create this view when the list is associated with the 'Documents; folder. However I have created several custom
    lists where I can only see these items when I am on the navigation pane to the right and the unique custom lists are listed under 'recent'.
    Let me know if you can answer any of the following questions:
    1. When on the main SharePoint website, can lists be displayed in other locations than what I just listed? If so, where would I see these other lists?
    2. I would like to include the custom lists that are located in the 'recent' navigation pane as a view that only I can use. This would be based upon userid. If this is possible,  how would you combine the lists lists in the same view? If this is not possible,
    how would you set a view just for the lists listed under the 'recent' section?
    3. The content approval solution under versioning settings of a library to restrict the documents to only ones that the user created (and also Approver rights).  Then if they create a new view they still won't see the documents that were not created by
    them. What about custom lists that are not in the documents area but are in the 'recent' area? Would this restrict users to see only items that they created?
    4. Item level Permissions in advance settings solve this problem for the list in the document area and the custom list in the recent area? If so, how would you setup these values?

    As it turns out the, setting Item-Level Permissions in a library is fully supported with PowerShell!
    The PowerShell commands for changing this are very simple:
    $web = Get-SPWeb http://YourSite/
    $list = $web.Lists[“Your Document Library Name”]
    $list.ReadSecurity = 2
    $list.Update()
    $web.Dispose()
    Note the 3rd line which is where you determine the value for this setting using the following values:
    1 = “Read all items”
    2 = “Read items that were created by the user”
    If you wish to modify the values for Create and Edit access instead, replace .ReadSecurity with .WriteSecurity with
    the following values:
    1 = “Create and edit All items”
    2 = “Create items and edit items that were created by the user”
    4 = “None”
    For example:
    $web = Get-SPWeb http://YourSite/
    $list = $web.Lists[“Your Document Library Name”]
    $list.WriteSecurity = 2
    $list.Update()
    $web.Dispose()
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Sharepoint 2013 document library incoming email without attachment not firing event and not getting email

    sharepoint document library incoming email without attachment not firing event and not getting email
    If email contains attachment it works. Is there any setting in document library that will allow emails and eventhandler to fire with out attachment?
    MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint Lead

    What is the purpose of email sent to document library if no attachment. What document library will do what that email if it cant find attachment to save and create a spdoc object. If you want to store email/communication body then opt for site mailbox
    app.
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Save document from word into sharepoint library does not work !

    Hi,
    I'm trying to resolve a problem that i have with word and my sharepoint website.
    Some of my users have to open and RDP session on a windows 2008 server and work from there. They open their session with their credential and they do everything they do in local on sharepoint using IE.
    BUT, we have always and ever had an issue on this server as they c'ant save a document (Word or Excel) from office. They have to upload it from sharepoint uising IE. In example, i want to save my document from word into the sharepoint document library I  have
    this error message :
    "Windows doesn't find (http://intranet.sharepoint.com/DocumentLibrary/). Check and retry".
    If I open my sharepoint site and i upload the document it works perfectly. Also if I open and edit an existing document from any library it will work with word. The problem seems to happen when i want to browse sharepoint from word for saving files...
    As this server is a windows 2008, IE version is 9 and the office version is the same as on all computers (Office 2010 SP2 32Bit)
    Any help would by appreciated
    Regards

    Hi,
    I understand you encountered the issue when save document from Office client application to SharePoint 2010 site.
    Is there any Proxy settings in networking side? Please bring up IE > Internet options > Connections > Lan settings. If so, please uncheck options in Proxy server and test the issue again.
    If you have deploy GPO to add SharePoint site into Trusted sites, please check if there is any other GP associated with trusted sites that might affect the issue. You could also remove it from Trusted sites via IE options and test the issue again.
    In addition, please provide more error message to help narrow down the issue, you could locate error information in Event log at least.
    Regards,
    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] .
    Rebecca Tu
    TechNet Community Support

Maybe you are looking for

  • How many devices can you have to your itunes library

    How many devices ( Iphone,Ipod, etc) can you have to your itunes account?

  • Link to equivalent page in another language

    I'm in the process of building a new site, English and French. Using simple HTML and/or JavaScript (or maybe ASP or CGI) does anyone know of a way to have a link dynamically change depending on the page the user is on? For example, if I am on www.web

  • Link in PDF not opening from within browser

    Hi, I have a PDF file with a link to a file share. it works perfctly if i open Adobe Reader and click on the link. However if i open the PDf in browser teh link does not work. Has anyone seen this before? The link is: The error is: Any suggestions ar

  • Assigning of iviews

    Hi all I have created two iveiws KMNavigation iview web dynpro iview I want to assign these iviews to folder which is present in a workset How to do that thanks in advance

  • Antivirus software exclusions for DFS and Hyper-V

    I am rolling out an updated antivirus solution to our DFS server and Hyper-V (Windows 2008 and 2012) and I am curious of the following: 1. What are the exclusion suggestions for Hyper-V servers?  I found a URL that showed the exceptions to add but I