01-08-2015 07:27 PM
I have queried to get a particular folder by the folder keyword (policy number) successfully.
Now that I have the folder I would like to query for specific documents within that folder.
Is that possible?
Thanks,
Diane Asberry
01-09-2015 05:29 AM
Hi Diane -
If you have the Folder object, you can call GetDocuments() off of it to retrieve all the Documents in the folder. For details, see the SDK article at:
Home / Unity API / Reference / Hyland.Unity Namespace / Folder Class / Folder Methods / GetDocuments Method
Currently you cannot retrieve a subset of the Documents within a Folder. You are limited to retrieving all of the Documents. If you want to filter them further you'll have to do that by filtering against the contents of the DocumentList that is returned from Folder.GetDocuments().
Does this help?
Nathan
01-09-2015 05:44 AM
Hi Diane,
The Folder.GetDocuments() method returns a DocumentList representing the documents for that folder. You should be able to traverse that list to find the documents you want more quickly than you would execute a DocumentQuery, and since you've already got the list itself, you're not expending a query every time you search for a subset of documents.
For example:
var oFolderDocuments = oFolder.GetDocuments(1000);
foreach (var oDoc in oFolderDocuments.where(odDoc => odDoc.DocumentType.Name == "My Search Doc Type")) {
// ... Do something with the selected documents
}
Of course, you could do the same thing with document dates, rendition file types, or whatever your search criteria are.
Kind regards,
-Scott
01-09-2015 05:45 AM
Thanks. Not the answer I was hoping for.
The suggestion you made about retrieving all the documents and then filtering against the list is the approach that I took.
I was just hoping for the possibility of a nested query making the process more efficient and cleaner.
Thanks again
Diane Asberry
01-09-2015 06:29 AM
Hi Diane -
If the subset of documents remains constant from query to query (i.e. always requesting the same set of doc types) then one option would be to create a separate folder that contains the specific documents for use by the API.
Regards,
-jeff
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.