10-21-2013 10:36 AM
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?
10-22-2013 07:45 AM
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.
10-22-2013 10:33 AM
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
10-22-2013 10:47 AM
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
10-22-2013 11:00 AM
Worked great, thanks for your help.
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.