Tuesday, September 1, 2015

OnBase Unity C# Visual Studio code to create a document object

In many cases you'll need a document object to perform actions on it. Here are the basics:

Create an application session
        AuthenticationProperties authProps = null;
              authProps = Hyland.Unity.Application.CreateDomainAuthenticationProperties(TestAppServer, TestDatabase);
                authProps.LicenseType = LicenseType.Default;
                  g_Application = Hyland.Unity.Application.Connect(authProps);

          Run your query to find the document's handle. Creating a SQL connection and running it is in a separate post.

                  long docID = Convert.ToInt64(dr[0].ToString().Trim());

                  Document doc = g_Application.Core.GetDocumentByID(docID);

          Once you have a document object you can update keys, attach lifecycles, etc.

          1 comment:

          1. But UnIdexed document can not be accessed with this function

            ReplyDelete