Copied to clipboard

Flag this post as spam?

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


  • Mouhot 9 posts 29 karma points
    Jul 30, 2010 @ 11:03
    Mouhot
    0

    Document..Save() function... what for ?

    Hi guys

    I am trying to implement the "Relate copied items to original" functionnality. Basically, on parent update I am copying all properties values to its childs.

    here is my code :

    Document copy = new Document(r.Child.Id);

    foreach (umbraco.cms.businesslogic.property.Property p in documentObject.getProperties)
    {
              copy.getProperty(p.PropertyType.Alias).Value = p.Value;
    }
    //copy.Save();

     

    It is working as I want but I thougt that I would have to save (copy.Save();) childs documents at the end but I noticed that it is not necessary...

    I was just wondering why is it not required and what is the Save() function for ?!

     

  • atze187 160 posts 215 karma points
    Jul 30, 2010 @ 11:40
  • Mouhot 9 posts 29 karma points
    Jul 30, 2010 @ 11:51
    Mouhot
    0

    Awesom 

    it is good to know, thanks a lot atze187

  • Richard Soeteman 3875 posts 12037 karma points MVP
    Jul 30, 2010 @ 12:04
    Richard Soeteman
    0

    If you call the Save Method, BeforeSave and AfterSave events are fired.

  • 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