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 239 karma points c-trib
    Jan 11, 2016 @ 13:44
    NDDT
    0

    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 239 karma points c-trib
    Jan 12, 2016 @ 10:27
    NDDT
    0

    Found the problem.

    You should use UpdateDate instead of CreateDate

Please Sign in or register to post replies

Write your reply to:

Draft