Copied to clipboard

Flag this post as spam?

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


  • Jayesh 7 posts 27 karma points
    May 15, 2012 @ 07:34
    Jayesh
    0

    how to find the relation.child.id to related document id?

    hello ,

    I am new to Umbraco using umbraco 4.7.2 and used relation api to create the related documents/nodes ....now for some operations and actions like unpublish,delete and hide in navigation , i wannt to find the related document/node id  i.e [that is]  [ relation.child.id == currDoc.id ] if true then perform the action. i had retrun the following code but does'nt help much.

    Document currDoc = new Document(sender.id);

    Relation[] relations = Relation.GetRelations(sender.Id);

             

    foreach (var relation in relations)

                {

                    if (relation.Child.Id == sender.Id)

                    {

               

      //   relation.Delete();

     

    currDoc.delete();    // delete the related document/node. 

                    }

                }

Please Sign in or register to post replies

Write your reply to:

Draft