cancel
Showing results for 
Search instead for 
Did you mean: 

Unity Form and relating an EXISTING document attachment

Tanya_Warington
Confirmed Champ
Confirmed Champ

Hello.

Unity Forms now allow Existing Document Attachments, which is great!  But how do you relate/tie the attachment of the existing doc to the new Unity form?  It does not inherit common keywords of the new Unity form, since the attached doc already exists in OnBase. 

 

I need to be able to tie the newly created Unity form that has an existing document attached, together.  From the Unity form, I'm hoping to be able to compose a letter to send out with the attachment.

 

Can anyone tell me how you do this?

 

Thanks much!

Tanya

1 ACCEPTED ANSWER

Eric_Simpson1
Star Collaborator
Star Collaborator

I believe you found one of the best approaches in another post... EP3- Unity Forms and Attached Documentation (hyland.com) using the sql query from @Scott Johnson .  (Note:  I removed the double quote on the WHERE clause.)  The key is the use of the special Document Handle keyword.

 

select a.itemnum, d.ufattachmentitemnum
from <dbname>.hsi.ufforminstance a,
<dbname>.hsi.ufattachxdoctype b,
<dbname>.hsi.ufattachxdoctype c, <dbname>.hsi.ufformxattach d
where
a.formrevnum = b.formrevnum
and a.ufformnum = b.ufformnum
and a.formrevnum = c.formrevnum
and a.ufformnum = c.ufformnum
and c.uffieldkey = b.uffieldkey
and c.uffieldkey = '<Attachment Control Name>'
and c.itemtypenum = b.itemtypenum
and c.ufattachdtnum = d.ufattachdoctypenum
and a.itemnum = d.itemnum
and d.flags = 0
and a.itemnum = <Form doc handle>

 

1.  Put the query in an external autofill, referencing the OnBase database to return the doc handles of the attachments.

 

2. Add the Document Handle keyword (numeric, up to 20 digits) to your Unity form doc.

 

3.  Set a property value with your Unity form's document handle, then set the autofill's primary keyword with that value, and trigger the autofill to return the doc handles of the attachments.

 

4. If your query returns the doc handles into a different keyword, copy the values to the Document Handle keyword on your primary doc/Unity form using the Copy Keyword action

 

5. In the Send Notification action, the Attachment config will let you attach Related documents by Document Handle.  This attaches docs whose doc handle is contained in the primary doc's Document Handle keyword.

85a5df48685041368dfcadac70e36b24

 

6. If you want to add the Unity form's doc handle to the attachments to relate them back to the form, use the Copy Keyword to Related Item command.  As shown here, it copies the primary document's doc handle to the Middle Name keyword on the related doc.  These related docs are found in this example by having their doc handles in the primary doc's Document Handle keyword (see #4 and #5, above).  I would normally copy the primary doc's doc handle to the related doc's Document Handle keyword, and vice-versa, but wanted to more clearly differentiate the keyword from the ">> Document Handle" system value.

 

021f74ed838f4388bfef694e4d5eb9bd

 

6dff4c21154c47818f12e6a6b00027c7

View answer in original post

5 REPLIES 5

Thank you, @EricS, for the detailed post.  This is exactly what I did and it's working well!  I like your approach to #6 too.  And of course, big shout out to @Scott Johnson for the query, lifesaver!