cancel
Showing results for 
Search instead for 
Did you mean: 

Pull dropdown list

Ted_Lucas
Champ in-the-making
Champ in-the-making

I’ve written a Visual Basic app that pulls in OnBase documents based on a user’s selections.  We use Retrieval in the Unity Client to allow the users to view documents but there are some users that use the VB app to view documents as well.  In Retrieval, there are dropdowns with specific entries that are used as keywords to limit the number of documents returned.  In the VB app, I need to be able to pull in the entries in the Retrieval dropdowns so I can populate the dropdowns in the VB app.  I’ve developed a way by looping through the documents that match the document types but when it pulls in 2000+ records, it takes about 7 minutes to loop through the records.  Is there an easy/fast way to pull in the Retrieval dropdown entries list?

4 REPLIES 4

Greg_Seaton
Star Contributor
Star Contributor

Hello TLucas,

 

SCR 165541 has been created to be able to pull back a subset of values from a keyword data set. It has not been completed yet, but you can have your first line of support add your organization to it.

You could also try posting how you are looping through the records. 7 minutes to go through 2000 records seems a little long. Someone else in this community may be able to help you with a more efficient way to perform that operation.

Ted_Lucas
Champ in-the-making
Champ in-the-making

Here's the code that I'm using to pull the subset of values from a keyword dataset.  Any help in speeding up the process would be greatly appreciated.

'=================================================================

Dim core As Core = gOnBaseApp.Core

Dim query As Hyland.Unity.DocumentQuery = core.CreateDocumentQuery()

Dim docType As DocumentType

Dim strDups As String = ":"

 

 ' strFind = Document Type (i.e. "Property Transactions")

docType = core.DocumentTypes.Find(strFind)

query.AddDocumentType(docType)

 

Dim strValue As String = ""

Dim doc As Hyland.Unity.Document

Dim kyRcrd As Hyland.Unity.KeywordRecord

Dim Kywrd As Hyland.Unity.Keyword

Dim docList As Hyland.Unity.DocumentList = query.Execute(Long.MaxValue)

 

Try

    ' Loop thru all documents returned by query

    For Each doc In docList

 

        ' loop thru each keyword record

        For Each kyRcrd In doc.KeywordRecords

 

            ' loop thru each keywords in each record

            For Each Kywrd In kyRcrd.Keywords

 

                ' strSubTypeNm = Keyword name (i.e. "Transaction/Project")

                If Kywrd.KeywordType.Name = strSubTypeNm Then

 

                    ' strValue = keyword from dropdown (i.e. "Land Purchase")

                    Select Case Kywrd.KeywordType.DataType

                        Case KeywordDataType.AlphaNumeric

                            strValue = CStr(Kywrd.AlphaNumericValue)

                        Case KeywordDataType.Currency, KeywordDataType.SpecificCurrency

                            strValue = CStr(Kywrd.CurrencyValue)

                        Case KeywordDataType.Date

                            strValue = CStr(Kywrd.DateTimeValue)

                        Case KeywordDataType.FloatingPoint

                            strValue = CStr(Kywrd.FloatingPointValue)

                        Case KeywordDataType.Numeric20

                            strValue = CStr(Kywrd.Numeric20Value)

                        Case KeywordDataType.Numeric9

                            strValue = CStr(Kywrd.Numeric9Value)

                        Case Else

                            strValue = ""

                    End Select

 

                    ' IF strValue IS ALREADY IN THE STRING, DON"T ALLOW DUPLICATES

                    If InStr(strDups, ":" & strValue & ":") = 0 Then

                        Me.cboSelSubType.Items.Add(strValue)

                        strDups &= strValue & ":"

                    End If

                End If

            Next

        Next

    Next

Catch ex As Exception

    MessageBox.Show(ex.Message, "ERROR FINDING SUB TYPES")

 

End Try

Justin_Walker
Champ in-the-making
Champ in-the-making

Hello!

In OnBase 12, the API introduced the ability to retrieve a DataSet from a keyword type.  If you are on a version before 12, you would need to query the database in order to get the Dataset values.  I would never recommend looping through a document collection as you've done here, simply because it takes so long.

I am not terribly proficient in VB.net, but this is approximately what you would need to do:

 

Dim KeywordType as Hyland.Unity.KeywordType = core.KeywordTypes.Find( strSubTypeNm )Dim DataSet As Hyland.Unity.KeywordDataSet = KeywordType.GetKeywordDataSet()Dim DataSetItem as Hyland.Unity.KeywordDataSetItemFor Each DataSetItem in DataSet	Me.cboSelSubType.Items.Add( DataSetItem.AlphaNumericValue )Next 

Check out the SDK in the Unity Section:   Home / Programmer Guide / Documents and Keywords / Working with Keywords / Working with Keyword Data Sets

Ted_Lucas
Champ in-the-making
Champ in-the-making

Worked great, thanks for your help.