Copied to clipboard

Flag this post as spam?

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


  • Pete 213 posts 285 karma points
    Nov 15, 2012 @ 20:21
    Pete
    0

    Document MakeNew not saving property data

    I'm using:

    Document doc = Document.MakeNew(name, dt, author, parentid);
    doc.getProperty("messahe").Value = "Hello World";
    doc.Save();
    umbraco.library.UpdateDocumentCache(doc.Id);

    To make a new document/node, it makes the doc/node no problem, but it does'nt save property data.

    Any ideas?

  • Pete 213 posts 285 karma points
    Nov 15, 2012 @ 20:45
    Pete
    0

    Ah you have to use doc.setProperty,

    but weird how:

    Media media = new Media(startMedia.Id);
    media.getProperty("galleryPassword").Value = password.ToString();
    media.Save();

    Works ok.

  • Craig Noble 41 posts 584 karma points c-trib
    Nov 16, 2012 @ 00:28
    Craig Noble
    0

    Can I ask, how new is doc.setProperty?

    I didn't know that method existed as I often use doc.getProperty to set values and works in 4.7.x.

  • 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