Copied to clipboard

Flag this post as spam?

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


  • Trist 3 posts 23 karma points
    Feb 03, 2012 @ 03:18
    Trist
    0

    Update Document Property gives No Document exists with Version error

    Hi, I was just doing a very simple property update and no matter what id I use I get a No Document exists with Version error. This happens from my page that's doing the update plus I also get the same error when I click on the item in the CMS.

    I tried doing a rollback but that produces the same error. My code is below. It's pretty simple so i don't know what is going on. Can someone shed some light on the subject please?

     

    Document doc = new Document(1097);
    doc.getProperty("update").Value = 5;
    doc.Save();
    
    User publisher = User.GetUser(User.getUserId("admin", "password"));
    doc.Publish(publisher);
    umbraco.library.UpdateDocumentCache(doc.Id);

  • Trist 3 posts 23 karma points
    Feb 03, 2012 @ 03:52
    Trist
    0

    Got it. I just entered 0 as the user id instead of getting the idea from the username and password.

Please Sign in or register to post replies

Write your reply to:

Draft