art5sib

Find AFElement parent

Discussion created by art5sib on Jun 25, 2012
Latest reply on Jun 25, 2012 by Ahmad Fattahi

Hello.

 

I have AFElement object and I want find "parent" element(s) of particular template. Can I find it with single sdk call? I.e., in this structure:

 

A1
\-B1
  \-C1
  \-C2
    \-E1

 

is there any method to get A1 (template "A") if I have only E1 AFElement object with something like this:

 

E1.FindParents(Database.ElementTemplates["A"]);

 

I can use E1.Parent property go up in the tree, checking each parent element and so on, but I think it will be really expensive operation.

 

 

 

 

Outcomes