How to get previous published versions of publishing pages in sharepoint 2010?

Hi all,
I have to get last published version only if effective date(custom column) is changed. So i have to check two conditions one is whether it is published or not and other is effective date is changed or not. If effective date is changed get the last published
version and copy this version and move to other library.
suppose 6.0(published), effective date 05/20/2013
             6.1(draft), effective date 05/20/2013
             7.0(published), effective date 06/20/2013
Here i have to get 6.0 published version, copy and move to other library.
So how can i achieve this one. what's the best way to do this? either workflow in SPD / VS2010 or event receivers. Please guide me.
Thanks in Advance
san

Hi Emir,
Your code works fine. It does copy the previous version page to another library. But when I attempt to edit the copied page it throws an unexpected error. I traced down the ULS log and I found the error saying. Could you help me to overcome this error?
System.ArgumentException: Column 'PublishingPageLayout' does not exist. It may have been deleted by another user.   
 at Microsoft.SharePoint.SPFieldCollection.GetField(String strName, Boolean bThrowException)    
 at Microsoft.SharePoint.SPListItem.GetValue(String strName, Boolean bThrowException)    
 at Microsoft.SharePoint.SPListItem.get_Item(String fieldName)    
 at Microsoft.SharePoint.Publishing.TemplateRedirectionPage.ComputeRedirectionVirtualPath(TemplateRedirectionPage basePage)    
 at Microsoft.SharePoint.Publishing.Internal.CmsVirtualPathProvider.CombineVirtualPaths(String basePath, String relativePath)    
 at System.Web.Hosting.VirtualPathProvider.CombineVirtualPaths(VirtualPath basePath, VirtualPath relativePath)    
 at System.Web.UI.DependencyParser.AddDependency(VirtualPath virtualPath)    
 at System.Web.UI.DependencyParser.ProcessDirective(String directiveName, IDictionary directive)    
 at System.Web.UI.PageDependencyParser.ProcessDirective(String directiveName, IDictionary directive)    
 at System.Web.UI.DependencyParser.ParseString(String text)    
 at System.Web.UI.DependencyParser.ParseFile(String physicalPath, VirtualPath virtualPath)    
 at System.Web.UI.DependencyParser.GetVirtualPathDependencies()    
 at Microsoft.SharePoint.ApplicationRuntime.SPVirtualFile.CalculateFileDependencies(HttpContext context, SPRequestModuleData basicRequestData, ICollection& directDependencies, ICollection& childDependencies)    
 at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureDependencies(HttpContext context, SPRequestModuleData requestData)    
 at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureCacheKeyAndViewStateHash(HttpContext context, SPRequestModuleData requestData)    
 at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.GetVirtualPathProviderCacheKey(HttpContext context, SPRequestModuleData requestData)    
 at Microsoft.SharePoint.ApplicationRuntime.SPVirtualPathProvider.GetCacheKey(String virtualPath)    
 at Microsoft.SharePoint.Publishing.Internal.CmsVirtualPathProvider.GetCacheKey(String virtualPath)    
 at System.Web.Compilation.BuildManager.GetCacheKeyFromVirtualPath(VirtualPath virtualPath, Boolean& keyFromVPP)    
 at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)    
 at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)    
 at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)    
 at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)    
 at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)    
 at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    
 at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Similar Messages

  • How to get Privacy Policy value for each userprofile in sharepoint 2010?

    In userprofile application, we have defined Privacy Policy of mobilephone feild as optional, so every user has option to choose visibility scope of this property to "Everyone/My Manager/my colegues/Only Me" .
    Now I am trying to get mobilephone value and their selected visibility option for each user.
    I am able to get mobilephone value but I could not get "what each user has chosen as their visibility scope"?

    Hi,
    According to your post, my understanding is that you want to get Privacy Policy value for each userprofile in sharepoint 2010.
    You need to use RunWithElevatedPrivileges method to impersonate user.
    To get the get mobilephone policy, you can use user["CellPhone "].Privacy.
    For more information, you can refer to:
    c# - Getting property privacy with Sharepoint 2010
    How to Programmatically Impersonate Users in SharePoint
    Managing Sharepoint 2010 Profiles Programmatically
    Thanks,
    Linda Li                
    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]
    Linda Li
    TechNet Community Support

  • How to get the original version of Web report in BW ?

    Hello Friends ,
    I have transported one Web report from BW development to BW Production System.
    But unfortunately , the desired result not me met .
    So I have been asked to keep the original version of the Web report.
    As the new version of Web report has replaced the previous one ,
    So could anybody tell me how to get the original version of Web report in BW ?
    Many thanks in advance !!!!!!!!

    Hi,
    You can use the Transaction STMS choose the option "Import Overview" . In the GOTO tab select "History" and choose "Import History".
    Here you can find the history of requests imported to the prod system.
    Regards,
    K.Manikandan.

  • How to get the last version of flash in MSI format automatically?

    How to get the last version of flash in MSI format automatically?
    Roberto Neigenfind
    Bravo Tecnologia
    www.bravotecnologia.com.br

    Hi Barbara,
    Flash Professional CS5.5 is a 32-bit application which can be installed on computers with either 32-bit or 64-bit operating systems.
    You can purchase this by Adobe's backward Licensing policy :
    " Adobe allows program members to order a current-version license but use a prior version. These members can contact Adobe Customer Service to request a serial number for the earlier version if they do not already have one. Prior-version software is available via ESD and can be purchased through standard resellers. The program member must follow all guidelines of the current-version EULA. "
    Please check the doc : http://www.adobe.com/volume-licensing/policies.html

  • How to get 64 bit version for premiere elements 12

    How to get  64-bit version for Premier Elements 12 ? 
    I download from ADMISY site.
    Click on win 64 bit and download it.
    When I try to install ther is a error  this download version is not for 64 bit I have try many times but same result

    Hello
    I have been away some days
    ADMISY is a software partners for Adobe
    I running Win 7 Home Edition
    I have received a card with a code when I bought the program and the I
    download from ADMISY
    Sending serial and installation warning
    PhotoshopElements_12_WWEFDJ.7z
    PhotoshopElements_12_WWEFDJ
    PremiereElements_12_WWEFDJ_win32.7z
    PremiereElements_12_WWEFDJ_win32
    I can not find a 64 bit version of 32-bit or 64-bit version of downloads
    This is information I have
    Best regards
    Erling Magnusson
    2015-02-04 22:33 GMT+01:00 Adobe Forums <[email protected]>:
        How to get 64 bit version for premiere elements 12  created by A.T.
    Romano <https://forums.adobe.com/people/A.T.+Romano> in *Premiere
    Elements* - View the full discussion
    <https://forums.adobe.com/message/7162950#7162950>

  • How to get Adapter Engine version in PI 7.1?

    Hi all,
    How to get adapter engine version in ehp 1sap 7.1 sp08 ?
    Thanks
    Sunil

    Hi Sunil,
    Please follow this -
    http://<hostname>:<port>
    In the system information page, download the component version information, and check out the version there.
    Hope this resolves your problem.
    Regards,
    Neetesh

  • HT1923 how to get the old version of itunes

    how to get the old version of itunes. i dont like the new one. pls help.

    If you want iTunes 10.7:
    http://support.apple.com/kb/DL1576
    But before you to go the effort of trying to downgrade, try these steps, presuming you're referring to iTunes 11:
    - Press Control-B to show the menus
    - From the View menu, select "Show Sidebar" and "Show Status Bar'
    That makes iTunes 11 look much like earlier versions of iTunes and satisfies many people.
    Regards.

  • How to get the trial version of adobe access whether can protect content

    i submit info in
    https://www.adobe.com/cfusion/mmform/index.cfm?name=flash_access_trial_cert
    but nobody contact me..
    How to get the trial version of adobe access?
    Thanks

    Hello,
    Apologies for that!  Currently, Adobe is shut down for the holidays which is why you're seeing a delay. Adobe will resume work again on January 2nd.
    If you can private message me your contact information, I can contact our sales team to make sure they are aware of your request.
    Sent from my mobile,
    /Eric

  • How to get the latest versions of Internet Explorer t

    We are running Single Primary Site with SCCM 2012 R2. 
    I
    cant seem to find out how to get the latest versions of Internet Explorer to be included in software updates?  Do you have to download this separately and install manually?

    Like Henrik said, make sure you have the Classifications selected that you want to address. IE 11 is the current browser, that was added to the catalog a few months back. If you are searching for this month you wont find it.

  • How to get current/present version guid from CRMD_ORDERADM_H ?

    Hi,
    Can any one tell me  how to get the current version guid value from CRMD_ORDERADM_H table for Business Object type 'BUS2000113' .
    For example for one contract if we have more than one version then how to get the latest version guid from this table?
    If I use FM ' BBP_PD_CTR_GETDETAIL'  and in version table how to know which one is the latest/current version?
    Need information for versions.
    Thanks a lot.
    Kevin.

    Hello Kevin,
           In FM  <b>' BBP_PD_CTR_GETDETAIL'</b> look at version table <b>E_VERSION</b> - Here you can check 'VERSION_' or there is another field 'CREATED_AT' - by using these you will get latest version.
    Regards,
    Shiv

  • How to get my free version of lion after buying a new mac, how to get my free version of lion after buying a new mac, how to get my free version of lion after buying a new mac

    I have just recieved my new mac book pro and I was wondering how to get my free version of Lion!
    Can anyone help me with this matter?!

    Try http://www.apple.com/macosx/uptodate

  • HT201441 I don't have owner's phone number, how to get  previous owner's Apple ID(email address) and send him a email let him remove the device from the account.

    I don't have owner's phone number, how to get  previous owner's Apple ID(email address) and send him a email let him remove the device from the account

    There is no way for anyone on this forum to assist you.  Apple will also not assist you.  If you purchased the device thru ebay, file a claim.  If you purchased it some other way, I'm sorry.  there is nothing anyone can do to help you.

  • Can't Publish Slides from PowerPoint 2013 to SharePoint 2010 Slide Library

    Hello all,
    When I attempt to publish PowerPoint 2013 slides to a SharePoint 2010 Slide Library it informs me that it failed. I am able to publish PowerPoint 2010 slides without issue. All of my permissions are correct. Is it possible to publish PowerPoint 2013 slides
    to SharePoint 2010?
    The weird thing is that while I can't publish, I can compile a new slide deck in PowerPoint 2013 using the "Copy slide to presentation" button in the slide library of my SharePoint 2010 site.
    Thanks!
    Kelly
    Personal Blog: http://thebitsthatbyte.com

    When I get this error it is because SharePoint is not passing the credentials to the network share where the slide library is located. So when PowerPoint
    tries to upload slides to SharePoint it is giving an error of unauthorized (because your credentials are not being passed correctly). Every part of SharePoint is essentially a network shared drive just like you have an internal network to share files between
    employees. Assuming you are having the same problem for the same reason, here's the work around: 
    Set up a mapped network drive that goes to where the slide library is located. It should be something like this: \\sp.sharepoint.com@SSL\site\Sales\Slide Library
    When you connect to this drive it will prompt you for a log in (just like SharePoint would)
    Once you log in your credentials will be cached (until you reboot your system or it times out)
    You can then publish to your PowerPoint slides to the library either directly through PowerPoint or by going to the upload slides option on SharePoint
    The problem is it only last until you reboot. When you reboot it clears out your credentials then you have to log in again. I’m hoping someone can figure out why SharePoint is
    not passing the credentials properly so we can have true fix to this issue. Until then, this will get you by. 

  • How to get the form reference in .js page from .jsp page

    hi
    i have written one form in jsp page omething like:-
    <html:form action="/shopping" onsubmit="return false;">
    can anybody tell me,how to get the form reference in .js page from .jsp page ,
    i have tried:-
    var formRef = document.forms[0];
    butits not working.
    Thanks.

    Its very simple......y cant u prefer google...Bad
    c this example...
    function submit()
    alert("textbox"+ document.forms[0].name.value);//to get textbox value in js
    document.forms[0].submit();//to submit jsp page using js
    <html:html>
    <html:form action="/shopping" onsubmit="submit()">
    <html:text property=name>
    learn to search in google..
    </html:form>
    </html:html>

  • How to get windows username printed on each page irrespective of application? we have cm6030f.

    How to get windows username printed on each page irrespective of application? we have HP CM6030F.

    Hi,
    Normally, you will receive a Windows Azure Pass from your local Windows Azure team. Please try to contact your local Windows Azure contact (http://support.microsoft.com/gp/customer-service-phone-numbers?wa=wsignin1.0
    Also, you could see this page
    http://www.windowsazurepass.com/AzureU/AcademicFAQ and apply the free trial azure via (http://www.windowsazurepass.com/AzureU/).
    Q: I am a student. Can I apply for a pass?                     
    A: Windows Azure Educator Grants are only for valid faculty. If your faculty has been awarded a Windows Azure Educator Grant, you will be able to get a pass through him/her for you coursework. If you are interested in learning more about Windows Azure,
    we encourage you to share these Educator Grants with your faculty or sign up for the FREE 3-month trial offer. 
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • "how to get to the bottom of a page fast on the iPad Air"

    how to get to the bottom of a page fast on the iPad Air"

    thank you!  I am admiring my three dots and considering which cat's picture I should upload as my avatar.
    yes, the scrolling down in sections I have managed.  I thought you were saying one set of double taps would go straight to the bottom.
    here's another question for you:  on my iMac by holding the command key down I can make a link open in a new tab.  Do you know if there is a way to do that on the iPad?

Maybe you are looking for

  • ORA-02068 Error Message

    I recieved this error message, when running a procedure: ORA-02068: following server error from DBLINK ORA-03114: not connected to ORACLE ORA-06512: at line 13 DBLINK is a database link to a remote database. Is it as simple as the remote database bei

  • How do I tell if my new macbook air is 64 bit or 32 bit

    I have a new macbook air 13" monitor. I need to know how to figure out if it is a 64 bit or 32 bit. I have Yosemite. 10.10 (I think)

  • More then one itunes on same computer?

    My sister and I have our own iPod nanos but we share the same computer. Is there a way to have two itunes on the same computer? Or are there any suggestions on how to manage our music separately, since we have no intentions of sharing music with each

  • Synchronize Files error on Creative Cloud desktop

    Hi there, I can't synchronize anymore my files with the creative cloud Desktop. I am running Creative Cloud Windows 8.1 64 bits. My OS and my softwares are uptodate. I think it's since 1 or two CC Desktop update that i can't synchronize files anymore

  • Boot Camp isn't letting me install!? Please Help

    I load up Boot Camp Assistants, I installed the Windows Support Software on to a disc and I come to the 'Create a Partition for Windows' part; I set up the memory I want for the Windows (75GB) and click 'Install' but it keeps coming up with 'The inst