cancel
Showing results for 
Search instead for 
Did you mean: 

Java Unity API Exception

Srini_Eluru
Champ in-the-making
Champ in-the-making

I am trying to create a new Unity form by retrieving an existing Unity form template in my JAVA project.I am using the java API. Here is my code snippet to get the form template:

FormTemplate template1 = core.getUnityFormTemplates().Find("TestUnityDocType");

 if (template1 != null)  {     System.out.println("Found Unity Template: "+template1.getID());

 }          else  {

            System.out.println("Unity Form Template not found.");

 } I am getting the following error:

.....java.lang.IllegalStateException: Type Hyland.Unity.UnityForm.FormTemplate does not implement IIndexedByName.

Is there a different method that supports the above functionality in JAVA?

 I am trying to achieve:

1)Find the Unity template. 2)Add form Keywords. 3)Save the document in Onbase.

3 REPLIES 3

Phil_Montag
Champ in-the-making
Champ in-the-making
Can you try it using the numeric value of the form instead of TestUnityDocType. I had luck with that once in a similar situation.

Rob_Herman
Star Contributor
Star Contributor

Good afternoon,

This appears to be a defect that we fixed in build 13.0.2.162 and later builds of OnBase.

To work around the problem, you can either follow Phil's helpful suggestion of searching by the ID, or manually loop through the list of FormTemplate objects checking to see if the name matches.

If you have any other trouble, please let us know.

--|Rob

Srini_Eluru
Champ in-the-making
Champ in-the-making

Thank you so much for the quick response.

I am able to get the template by ID.