Copied to clipboard

Flag this post as spam?

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


  • Topic author was deleted

    Mar 26, 2015 @ 12:43

    Update a node's CreateDateTime in Razor?

    Hi,

    I'm trying to change the CreateDateTime for a node/document, but it doesn't appear to be having any effect. This is what I'm trying to far:

    dynamic node = new DynamicNode(1065);                     
    Document n = new Document(node.Id);
    n.CreateDateTime = node.articlePublishedDate;
    n.Save();
    n.Publish(new umbraco.BusinessLogic.User(0));
    umbraco.library.UpdateDocumentCache(n.Id);    
    

    Am I going about this in the right way? And also, am I correct in assuming that it can even be changed?

  • Ed Parry 64 posts 249 karma points c-trib
    Mar 27, 2015 @ 09:04
    Ed Parry
    0

    Anyone have any tips? The API seems to suggest the CreateDateTime has get/set, so it should work? Running the code through with breakpoints, it updates the CreateDateTime, but something with the save/publish seems to revert it back?

Please Sign in or register to post replies

Write your reply to:

Draft