cancel
Showing results for 
Search instead for 
Did you mean: 

Standalone Keyword in Unity

Lucky_Kanwal
Confirmed Champ
Confirmed Champ

Hi All, I need help on the following:

i have hard time to understand Standalone Keyword in Unity. If I have Standalone Keyword, Single-Instance and Multi-Instance Keyword on a document. How to get value of Standalone Keyword and display on the form ? Any Code Example. How update Standalone Keyword ? Any Code Example. There is no clear example code in SDK for Standalone Keyword. Also in SDK : Note: Standalone Keyword Records return only the Keywords with values. What that means? Please provide any code example for Standalone Keyword.

 

Thanks for you help.

K

4 REPLIES 4

Daniel_Quill
Elite Collaborator
Elite Collaborator

Hi APILearner,

If you have the SDK you can find examples in under the SDK installation directory.

Example: C:\Program Files (x86)\Hyland\Hyland SDK\Data\UnityAPI\API_Sample_Scripts\UnityExamples

Q:  Standalone Keyword Records return only the Keywords with values
A:  This means that any keywords on a document that are left blank (have not value associated) that they will not be returned.  So, if a keywordRecord has keywords but they are all blank on the document the keywordRecord will not be returned.

If you working with multiple types of KeywordRecords you will need find the KeywordRecord that contains that keyword.  Once you have the keyword object you can they get its value to process it as needed.

 

Lucky_Kanwal
Confirmed Champ
Confirmed Champ

Thanks for the quick reply. I used the sample code but still Standalone Keyword are not displaying and they do have the values. Single-Instance and Multi-Instance Keyword are displaying but not the Standalone Keyword.

I am not sure what I am missing. Please help.

Here is the code:

 'Set the diagnostics level to verbose

            g_application.Diagnostics.Level = Diagnostics.DiagnosticsLevel.Verbose

' Obtain a document

 

Dim document As Document = g_application.Core.GetDocumentByID(138)

' Check that a document was returned

If (document Is Nothing) Then

 

Throw New Exception("The document returned was null")

Else

' Iterate through all Keyword Records

For Each keywordRecord As KeywordRecord In document.KeywordRecords

    ' Within each Keyword Record, iterate through all keywords

' and get the keyword name and the keyword value.

                  For Each keyword As Keyword In keywordRecord.Keywords

                      If (keyword.IsBlank) Then

                            lstoutput.Items.Add(String.Format("  {0} is blank", keyword.KeywordType.Name))

 

Else

                   lstoutput.Items.Add(String.Format("  {0} = {1}", keyword.KeywordType.Name, keyword.Value.ToString()))

Next              

Next              

'Write to the OnBase Diagnostics Console

                g_application.Diagnostics.WriteIf(Hyland.Unity.

Diagnostics.DiagnosticsLevel.Verbose, output)

           End If

Daniel_Quill
Elite Collaborator
Elite Collaborator

APILearner,

Are the keywords set up to be hidden on the document type?  If so, does the user that you are logging in with have access to the hidden keywords?  If the keywords are not hidden and they user does have access to them, you may need log into the OnBase client with same user and double check to ensure that user can in fact see the values.  The code you are using should return all keywords that on the document that have values (minus hidden/restricted keywords) if the user does not have access.  Beyond this, have you made any recent changes to the document type or keyword configurations?  Have you recycled the application server's application pool?  I may be a matter of clearing the application servers cache.

Regards,

Lucky_Kanwal
Confirmed Champ
Confirmed Champ

Hi Daniel, Yes, there was issue with AppPool. I refresh the AppPool of Unity service and Keyword was start showing for all type. Thanks for your help.