Deleting Old Versions SharePoint Web Parts

I have inherited an Enterprise Content Management tool with Custom web parts that allow users to upload document using Document Set and Document ID in SharePoint 2010. The code has some custom EventReceivers that do ItemAdded, check for user permissions
and add, delete items. My issue is Versions are created automatically for the user and the system account also creates Versions, making the Content Database grow quickly. I need to add C# methods in the code to retain only the current version for the user,
to stop the content database from growing quickly. We are currently running PowerShell scripts to purge the Content database weekly. I want to stop running the script and do that in the Event Receiver code. Can any one help me  with suggestions and some
code samples?
Ebenezer

Is there a way, you can change the library settings to remove versioning. That will just keep 1 version.
Also, in your event reciever and web part code, you can use the SystemUpdate method instead of update so that a newer version is not created.
Reference:
SystemUpdate
Hope this helps.
Rahul Gupta, MCSE, MCSD - SharePoint

Similar Messages

  • I want to download Photoshop CS6. Should I first deinstall my old Version CS4 and parts of CS5?

    I want to download Photoshop CS6. Shold I first deinstall my old VErsion CS4 and parts of CS5 from my PC?

    You can keep your old versions along side CS6.  You might want to test CS6 before you uninstall anything else.
    Nancy O.

  • Deleting old versions of Ipod

    Can deleting old versions of Ipod for Windows in Add/Remove programs safely free up disk space without harming the library? I need to make space on my hard drive! Any info would help. Thanks!

    If you have itunes 7, you can delete/remove all of them. If you want to be on the safe side, remove all but the most current one (aka 2006-06-28)

  • I have been using Elements11 for almost a year. I am suddenly getting the message:Some of the application componentsare missing from the application directory. Please reinstall. I deleted old version, reinstalled on my Mac and now get this message:A requi

    I have been using Elements11 for almost a year. I am suddenly getting the message:Some of the application components are missing from the application directory. Please reinstall. I deleted old version, reinstalled on my Mac and now get this message:A required application library failed to load and the product cannot continue. I also get the first message again. Organizer works but not editor. Frustrated!

    What a waste of space to paste the code.
    Why not ask in the iLife > iPhoto forum where your question belongs.

  • Dundas Gauge for SharePoint web part

    Hi,
    I'm using the Dundas Gauge for SharePoint web part, it seems that I have to add a seperate web part for each and every guage that I want added to the page, this means that inside each web part I have to add the connection string details for the sql database to get the data for the guage.
    If I have 20 guages on a sharepoint page, this means 20 connection strings, 20 hits on the db - it's not sounding good.
    Has anyone had any experience of this or has any thoughts on the best way to integrate this?
    Best Regards
    Kieran

    As long as the connection strings are the same connection pooling will probably be used (they could disable it if they wanted to but not very likely).
    It could still be 20 seperate hits to the database though. If each gauge is looking at a seperate dataset then absolutely it would require a trip to make the query.
    You should investigate if the controls support caching directly (very likely) and create a good caching strategy if you need 20 seperate query results on one page.

  • Delete old version?

    New iWork is now on my computer. Should I delete old version? If so hwo? I have A

    NO!
    Look at these forums- literally thousands of posts complaining about the new version.
    Use the new one to open only documents you know you have backed up becuase it can destroy formatting.  Play around with it and see if it suits your needs before ditching the old, working versions.

  • How do i delete old versions of itunes from my mac

    trying to free up space on my hard drive.  how do i delete old versions of itunes?

    Welcome to Apple Communities
    When you update iTunes, older versions are replaced. If you didn't update, go to Software Update

  • Delete old versions of PS?

    I had a lot of trouble getting PS 5.1 working on my computer because of license issues and have been afraid to delete older versions of PS thinking it might hose things again.
    I have CS 3, Bridge 3, CS5, and Bridge 5 installed.  Can I delete them?

    If you really are not desperate for HD space the best advice is to leave them as is.  They should not affect one another as they are.
    Deleting old versions can cause file associaton and other file access problems.

  • Sharepoint web part Page Load issue

    Hi ,
     We are developing Sharepoint 2013 Integration application, We are fetching the data from third party application and dumping data into sharepoint List for offline analysis.
    Synchronization steps
    1) fetch data from third party application
    2) delete the old data
    3) Insert the new data in List
    4) Show the data in custom web part 
    synchronization is taking lot of time, is there any profiling  tools , we can measure the performance of method , network traffic which is causing the issue.
    We need to load the page less than second
    Regards
    Pat

    Hi,
    Per my understanding, you might want to improve the performance of your web part page.
    A suggestion is that you can create a custom Timer job in the server side which handles the data fetching and updating in a list in the backend periodically, the burden
    on the custom web part would get decreased.
    About create and deploy Custom Timer Job Definition in SharePoint Programmatically:
    http://www.codeproject.com/Tips/634208/Create-and-Deploy-Custom-Timer-Job-Definition-in-S
    Thanks 
    Patrick Liang
    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]

  • Can anyone tell me why I can't update my itunes on my p.c?  I get a message saying: the feature you are trying to use is on a net work resource that is unavailable.   Tried uploading from websit, get msg can't delete old version.

    I need some serious help!
    I have been trying to update my itunes to version 10.7 and my Quicktime to version 7.7.3!
    Having no luck!
    So I tried selecting repair software on all of the Apple applications and they seem to have worked.
    Then I selected look for upgrades on my itunes (Help) main screen
    It said their were two updates -   Itunes  10.7   and  Quicktime 7.7.3
    I selected the option to update and the .exe files were loaded to my  Windows 7 p.c.
    However after part of the Itune update completed a message came up on the screen
    saying   "The feature you are trying to use is on a net work resource that is unavailable.
    O.k.
    I then went to the itunes website and tried again.  This time it checked my system the process seemed to be working and all of a sudden I got a message saying my old itunes programs could not be removed and or deleted.  So I tried to delete my old version myself without success it won't let me.
    I've run out of options and am not completely fustrated.
    I have itunes on my desktop, my iphone4, my ipod and in my car. 
    Anyone have any clue how I can resolve this problem?
    Chris Lane
    <Email Edited by Host>

    However after part of the Itune update completed a message came up on the screen
    saying   "The feature you are trying to use is on a net work resource that is unavailable.
    Which particular .msi file does the message go on to say cannot be found? (Several different .msi files might be mentioned in this context: itunes.msi, bonjour.msi, AppleSoftwareUpdate.msi, etc.)

  • Add or delete the summary links web part's[deployed as a VS solution] link using power shell

    hi,
     i am having a visual studio custom solution having page layouts implemented. In that solution i am having 1  summary links web part and in that i have hard coded few links and this is  deployed on ion dev and staging env.
    Now, the issue is : yesterday, customer came to me and asking me to change the links from http://abc to
    http://xyz/ in this summary links. can anyone pls throw some light,such that i can change this link using a power shell script. i know  if i go the VS solution and change the link and redeploy [ update-spsolution
    command] will work.
    but if the links are changing regularly , chnaging the vs solution and redeploying is not a good practice.
    if i elaborate li'l bit,  i am adding the screen shot : i need to get the summary link column's value and  need to update[ delete xisting one and  add new ones ]
    is there any way , i can change the links using power shell script?
    i tried the belwo power shells cript to get the page in the page layouts :
    $web = get-spweb
    "http://siteurl"
    $pubWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
    $pagesListName = $pubWeb.PagesListName
    $defaultAspxFile = $pubWeb.GetPublishingPage("$pagesListName/mycustomhome.aspx")
    $summaryLinkFieldValue = New-Object
    Microsoft.SharePoint.Publishing.Fields.SummaryLinkFieldValue
    // here am getting the NULL VALUE
    can i get the  summary links field correctly and  delete / modify the same?
    help is appreciated!
    ##$groupLink = New-Object
    Microsoft.SharePoint.Publishing.SummaryLink("My group")
    #$groupLink.IsGroupHeader = $true $summaryLinkFieldValue.SummaryLinks.Add($groupLink)

    Hi Shabeaut,
    Could you tell us why do you want to add a link web part to the master page for all pages?
    I tested that Summary Links web part (and other types of web parts) added in the master page under Quick Launch couldn't be edited when I edit the pages inherited from v4.master page, it looks by design.
    Have you tried using the Quick Launch to add the link instead if you want to show links in all pages.
    Thanks
    Daniel Yang
    TechNet Community Support

  • SharePoint - Web Part - SQL Server Reporting Services Report Viewer Error.

    Hi,
    I was just having a bit of a fiddle with the differen't web-parts available to add on our local SharePoint site, and as one of my tasks is to have a report automatically open when the page is opened i thought i would try to add the web-part 'SQL Server Reporting
    Services Report Viewer' just to see the outcome.
    Now, I don't much care about viewing the report at this time, but imediately after trying to add the web part i am being displayed with an error and no matter how much i navigate away from the page or close the browser the particular link to the page i was
    trying to insert the web-part into now displays an error.
    The error simply says 'An unexpsected error has occured' with various 'Correlation ID:' each time.
    Now i have a link to other parts or subsites of that SharePoint site and they work just fine, it's just when i try to click on the page where i wanted to put the web-part in it
    still comes up with an error. This page just so happens to be the home page so it really does need to be fixed.
    Please help!?
    Many Thanks,
    Plain_Clueless

    Hi again,
    Sorry for the bother, We have now fixed the issue for the time being.. all that was needed was a simple '?contents=1' at the end of the url which takes you to a menu where you can delete the
    necessary web-part that was causing the trouble.
    As for actually implementing the report onto SharePoint.. in future i will make Dev pages instead.. and it seems i may need to contact the admin side of building so they configure 'SQL Reporting 
    Services Report Viewer' properly.
    Thanks a lot though!
    - A little less Plain_Clueless
    Plain_Clueless

  • The XIr3 SharePoint Web Part for Webi is throwing errors to SharePoint.

    Hi Admin's, Have any of you seen this error... We've built an XIr3 environment to expose Webi via the PIK webpart to SharePoint as a reporting portal. The backend is Sql linked servers via an OLEDB provider from a vendor named OSI (PI historian). The environment rocks, and the BO/SAP software is doing exactly what we want it to, one admin issue though. BOXI is spamming our SharePoint admin with two pesky messages "Error: Failure in loading assembly: BusinessObjects.SharePoint.Utilities, Version=10.0.3300.0" and the same prefix with version 11.0.3300.0. Have any other admins experienced this? The configuration is working fine in production, our dev burn throws these two, and it is essentially preventing us from upgrading our DotNet framework from 2.0 to 3.5 which is the only  component in flux. The SP version is 12.0.633.5000. I just need to stop spamming my SharePoint friends and let them do their upgrade!

    The search center is just a collection of pages that has the appropriate search web parts.  YOu can change the Search Settings at the site or the site collection to change the results page used.  If you add a results page with the appropriate
    web parts to the site you can send the results anywhere.  But building a search center is the easiest way to do that.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Deleting old version of Java disabled ability to open AP and PO Accrual Rpt

    Hi I am an end-user and we are in the process of testing Oracle Financials, Purchasing, etc in order to upgrade to the latest version of Oracle. My IT group fiddled with my laptop and said I had 2 versions of Java and apparently deleted the old version on my laptop. Ever since then, I have been unable to open/view the 1) AP and PO Accrual Reconciliation Report and 2) Summary Accrual Reconciliation Report from the Purchasing module of Oracle. I can still view other financial reports that I run ( i.e. Inventory Value Report from Inventory module, Journal Entries Report from GL, Receiving Transactions Register from A/R). I currently have Java 6 update 29 installed but I am still unable to open reports from the Purchasing module.
    Can anyone figure out what happened and how do I re-enable the ability to view those Purchasing reports again?

    Did you substitute the VO or replaced the original VO itself? Check About this Page/Personalize Page to see the VO has modified query or not. If yes, try restarting the server (Apache bounce doesn't work sometimes, complete bounce/restart fixes the issue. I don't know why :-) ).
    Thanks
    Shree

  • Deleting old versions of PhotoShop Elements

    Jeez, all kinds of hoops to jump through just to get one stupid question answered.
    I just installed PhotoShop Elements 12. Is it safe to delete my old version, PhotoShop Elements 8, from my hard drive?
    P.S. Does anyone know why I had to submit my birthday to join the forum? With the latest security breaches on the Adobe site, giving out such personal information is dangerous. I guess Adobe doesn't really care about our security.

    No, that's not true, although you might get asked for a serial number from the old version on reinstall. However, if you're using windows, you might want to read through this, about the features missing from PSE 12:
    http://forums.adobe.com/thread/1302663?tstart=0
    Many of them can be reinstalled from your older version. (Macs are missing the same features, but since the mac version is now 64 bits, reinstalling old bits doesn't work.)

Maybe you are looking for

  • Getting error  connection timed out while invoking webservice from bpel.

    Hi, I am trying to call a secure webservice developed in .Net having extension .svc from the bpel service and in response i am getting error com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault} messageT

  • Delete restrict for ABAP Dictionary database table

    Hi, I defined two database tables in ABAP dictionary, one with master data, and one with records referencing the master data. I also defined a foreign key relationship in the second table, so that new entries in the second table are checked against t

  • Need help with reading a file

    Hello, I'm trying to read this file, but I keep getting a java.nullpointerexception at the end of it: Element: PART Content: (HEADER,CHAPTER+) Element: p Content: (#PCDATA) Element: INTRODUCTION Content: (HEADER,p+)+ Element: CHAPTER_NUMBER Content:

  • Has anyone else noticed that the iOS 6 Maps App is missing the area code for many places it has listed?

    If I try to look up a local business on the Maps App it drops a pin on all of the locations matching my search parameters. However, when I get details about a dropped pin, the phone number is usually missing the area code! For example, if the phone n

  • CCM 5.1: How to re-send the CDR to Billing Server

    Dear Sir, When the SFTP is broken and re-connected, the CDR manager does not re-send the CDR records that generated during the connection broken time. How can I or CCM re-send these records to Billing Server again to keep the Billing Report Coorect?