I am trying to (easily) find a way to get a document as all its decendants into a document collection to then export as XML. I am using the following:
var= Evaluate(“SELECT @Text(@DocumentUniqueID)='” + source.UniversalID + “’ | @AllDescendants”)
The evaluate statment returns nothing to the variant, but when placing the same statement into a view selection of a new view gets all the desired documents. Can anyone help with this?
Thanks
-kj
Subject: Using @AllDescendants for a document collection
I’d create a viewnavigator based on the grandparent document (with v.getentrybykey followed by v.createnavfrom) and then loop through the entries, adding each viewEntry’s document property to a collection.
Subject: Using @AllDescendants for a document collection
“SELECT” doesn’t really mean a lot outside of the context of a view selection formula. I suppose you could build a view of all documents sorted by $ref and throw GetAllDocumentsByKey at it, but is there any reason not to use the Responses property of your source document?
Subject: RE: Using @AllDescendants for a document collection
I see your point, but I need all descendants including grandchildren and so on. The only way I can see using this method is a recursive method. Which will work, but seems more complicated that needed.
Subject: RE: Using @AllDescendants for a document collection
Found a way around this. I created a view named tmp. I open the view, lock it, and change the selectionFormula property using the string in a previous post. I can then iterate through the view adding documents to the document collection, then export as dxl. I will have to build in logic to accomidate if the view is locked to go to sleep for a second or two. if anyone wants to see this code I can post.