Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • NDDT 68 posts 240 karma points c-trib
    Jan 11, 2016 @ 13:44
    NDDT
    0

    Rollback

    I'm trying to write code which rolls back the older Version of Content. It is executed but it doesn't have any effect. Does anybody know why?

            Enumerable<IContent> versions = Services.ContentService.GetVersions(id).Where(n => n.CreateDate < new DateTime(2016, 11, 01));
            IContent version = versions.OrderBy(m => m.CreateDate).First();
    
    
            IContent erg = Services.ContentService.Rollback(id, version.Version);
    
            Services.ContentService.SaveAndPublishWithStatus(erg);
    
  • NDDT 68 posts 240 karma points c-trib
    Jan 12, 2016 @ 10:27
    NDDT
    0

    Found the problem.

    You should use UpdateDate instead of CreateDate

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies