cancel
Showing results for 
Search instead for 
Did you mean: 

searching for documents based on document type

Abeer_AbuZant
Champ in-the-making
Champ in-the-making
Hello
I would like to ask if there is a way to retrieve documents based on document type ?
What I found is searching for a document using a given ID
one more question, I read about executing query , it should take a max no. of documents , what if i didn't know how many doc the query will give me and i want it to give me all documents?
Thank you.
1 ACCEPTED ANSWER

Harish_Kamal_Me
Confirmed Champ
Confirmed Champ

Here is a way to do it using the API

DocumentQuery docQuery = onbaseApp.getCore().CreateDocumentQuery();

docQuery.AddDocumentType(onbaseApp.getCore().getDocumentTypes().Find("SearchDocType"));

For specifying a MAX Count, there are 2 ways.

DocumentList docList = docQuery.Execute(docQuery.ExecuteCount())

or 

DocumentList docList = docQuery.Execute(Integer.MAX_VALUE)

 

Thanks,

Harish

View answer in original post

7 REPLIES 7

Chris_Arpajian
Confirmed Champ
Confirmed Champ

Hello Abeer ,

 

I would recommend looking at the Database Reporting Guide as page 10 discusses the hsi.itemdata table.  This table would allow you to pull back document information based on various parameters.  If you were looking backed on the Document Handle, then you'd use the column of itemnum.  If you wanted to look based on an entire Document Type, this would be the itemtypenum as also mentioned on page 10.

 

You would need to look up your Document Types #'s via Configuration or the hsi.doctype table or use this table for joining purposes against hsi.itemdata.  In SQL Server Management Studio if you were to run a select without additional contraints such as TOP, then you'll pull back all rows for your Documents based off of your constraints.  Perhaps a Select COUNT(*) from....  would first tell you how many rows your query is going to return before you would run the actual select that returns all of your rows.

Abeer_AbuZant
Champ in-the-making
Champ in-the-making

Thank you Chris for your answer,

sorry may be I didn't explain clearly and i put it in a wrong place. I meant how to do that by using API 

Hi Abeer,

I'll move this thread over to the Unity API forum so that our API experts can offer suggestions.

Ansley

What is the business case?
Getting started

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.