Copied to clipboard

Flag this post as spam?

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


  • Jakob Jensen 23 posts 43 karma points
    Feb 28, 2011 @ 11:25
    Jakob Jensen
    0

    update document

    int currentQuantity = Int32.Parse(currentDoc.getProperty("stock").Value.ToString());
    int total = currentQuantity - orderline.Quantity;
    currentDoc.getProperty("stock").Value = total.ToString();
    umbraco.library.UpdateDocumentCache(currentDoc.Id);

    i use this code to update the stock value, the value is updatet but it is first visibel when i go to the backend and click publish.

    what am i doing wrong???

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Feb 28, 2011 @ 11:55
    Stefan Kip
    0

    You should publish the document (currentDoc.Publish() method)

  • Jakob Jensen 23 posts 43 karma points
    Feb 28, 2011 @ 12:05
    Jakob Jensen
    0

    but then i need a user, and this is frontend :-(

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Feb 28, 2011 @ 12:24
    Stefan Kip
    0

    Just use this:

    currentDoc.Publish(currentDoc.User);
  • Jakob Jensen 23 posts 43 karma points
    Feb 28, 2011 @ 13:49
    Jakob Jensen
    0

    Hmm umbraco.config is still not updatet

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Feb 28, 2011 @ 13:52
    Stefan Kip
    1
    document.Save();
    document.Publish(document.User);
    umbraco.library.UpdateDocumentCache(document.Id);
  • Jakob Jensen 23 posts 43 karma points
    Feb 28, 2011 @ 14:05
    Jakob Jensen
    0

    thx :-)

Please Sign in or register to post replies

Write your reply to:

Draft