I have an element in a hierarchy that has a link in another location within the same hierarchy. If I want to prevent duplicate processing of this element, what attribute can I interrogate that will identify links or references?
The element.Parent property indicates the "Primary Parent". While navigating the hierarchy, you could verify the Parent property of the child is equal to the parent before processing (root elements will have a null (Nothing) for the .Parent property.
Alternatively, if your goal is to process all elements, and doing so in hierarchical order is not important, then it is more efficient to just find all elements, rather than navigating to them. The find will return an element once, no matter how many times it occurs in the hierarchy.
const int pageSize = 1000;
int startIndex = 0;
myElements = AFElement.FindElements(myDB, null, "*", AFSearchField.Name, false,
AFSortField.Name, AFSortOrder.Ascending, startIndex, pageSize, out totalCount);
if (myElements == null) break;
foreach (AFElement element in myElements)
// process element
startIndex += pageSize; // Advance to next page.
} while (startIndex < totalCount);
Thanks, all of that information was useful, though I'm surprised that this needed some intuitive thought to figure it. The icon you see in AF Explorer changes if it's a link, and I would be very surprised if there's not a flag to switch the icon rather than some processing to determine which icon to display.
However, since i'm using a recursive procedure, checking for parent is good enough for me.
Retrieving data ...