Copied to clipboard

Flag this post as spam?

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


  • Ash 8 posts 28 karma points
    Apr 14, 2011 @ 15:51
    Ash
    0

    How do I update the property of a node in an event?

    I'm setting the value of a property within an event handler

    void Document_BeforePublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)
    
    

     

    I'm trying to find a way for this property to be updated in the content node tree after successfully publishing the node. I find I have to click on the node in the tree before the new property value is displayed. 

     

    I've tried

    umbraco.library.UpdateDocumentCache(sender.Id);
    umbraco.library.RefreshContent();

    But no luck. Should I be using a different event?

     

    Thanks

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 14, 2011 @ 15:53
    Jan Skovgaard
    0

    Hi Ash

    I believe you should use umbraco.library.UpdateDocumentCache(doc.Id); to achieve this.

    EDIT: You might want to look at the API cheat sheet in the WIKI here: http://our.umbraco.org/wiki/reference/api-cheatsheet

    /Jan

  • 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