03-30-2018 11:35 AM
I am trying to get to all of the documents that have been attached into a folder under my object. I have tried a couple things and have not had any success. I look forward to any suggestions for how to get my documents!
//this object has a folder called Attachments in it's Folders, which has 11 document types that can be linked under it
Hyland.Unity.WorkView.Object myObj = originalObj.GetRelatedObject("LinkToMyInformation");
//first try, returns nothing
DocumentList myDocs = myObj.Documents;
//second try, myObj.Class.DocumentFolders[0] - .ID and .Name return the correct information, however the GetFolderByID returns null
FolderManagement folderManager = app.Core.FolderManagement;
Folder attachFolder = folderManager.GetFolderByID(myObj.Class.DocumentFolders[0].ID);
DocumentList myDocs = attachFolder.GetDocuments();
04-02-2018 12:51 PM
Hi Jonathan -
There are a couple of different "folders" that pertain to WorkView objects and I'm not totally clear which one you are referring to but maybe the following will help.
// This returns the "static" documents attached to the object
DocumentList myDocs = myObj.Documents;
// This returns the "dynamic" folders configured for a class (e.g. the Folders folder under
// the Class within OnBase Studio).
DocumentFolderList docFolders = myObj.Class.DocumentFolders;
Unfortunately, I don't see a way to get the documents for an object from the docFolder using the Unity API - you might have to generate your own DocumentQuery.
Lastly, there are the OnBase folder types configured for a class (e.g. the Folder Types tab for Class Mappings within OnBase Studio). Unfortunately, I don't see a way to get the folder types for a class (or object) using the Unity API - you might have to generate your own FolderQuery to retrieve the folders.
Hopefully I'm missing something and there's a more direct way to obtain the information that you want.
Regards,
-jeff
04-02-2018 12:51 PM
Hi Jonathan -
There are a couple of different "folders" that pertain to WorkView objects and I'm not totally clear which one you are referring to but maybe the following will help.
// This returns the "static" documents attached to the object
DocumentList myDocs = myObj.Documents;
// This returns the "dynamic" folders configured for a class (e.g. the Folders folder under
// the Class within OnBase Studio).
DocumentFolderList docFolders = myObj.Class.DocumentFolders;
Unfortunately, I don't see a way to get the documents for an object from the docFolder using the Unity API - you might have to generate your own DocumentQuery.
Lastly, there are the OnBase folder types configured for a class (e.g. the Folder Types tab for Class Mappings within OnBase Studio). Unfortunately, I don't see a way to get the folder types for a class (or object) using the Unity API - you might have to generate your own FolderQuery to retrieve the folders.
Hopefully I'm missing something and there's a more direct way to obtain the information that you want.
Regards,
-jeff
04-02-2018 01:33 PM
04-02-2018 01:57 PM
04-03-2018 06:17 AM
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.