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

Jen_Siegel
Confirmed Champ
Confirmed Champ

I see two possibilities.

 

1. Make sure that the Unity form and attachment doc types have keywords in common so you can find a way to identify the attached document via its keywords. If someone attaches a random document that has nothing in common with the Unity form's keywords, then this won't work.

 

2. Custom Unity script that looks at the link between the form and the attachment to locate the attached document. (Fair warning: I don't know how to do this.)

Good morning, Jen. 
Thanks so much for brainstorming this with me.  As you said, #1 wouldn't work, as there's every chance that someone will attach a random document, and I need to be 100% sure that the attached document is related to the Unity form, as we need to 100% send the right attachment to the right customer.  For #2, I'm in the same boat, no idea how to do Unity scripting.  If you think of any other possibilities, please pass it along, I would really appreciate it.

 

Tanya

Laura_McCormick
Champ on-the-rise
Champ on-the-rise

Hi Tanya,

 

Maybe a Related Items approach would work?  If you build the relationship in Studio (Primary doc=Unity form; Secondary doc = Attachment),  can you reference that Related Item (attachment) in the process you use to compose a letter?  I know this is possible with sending HTML notifications in Workflow using Actions for Related Items. 

 

Related Items - view supporting docs without leaving workflow

    • 1 - Build all Portfolio Relations
    • 2 - Build Portfolio Type
    • 3 - Map Portfolio Type to LC

Save Repository > Reset Cache - Relaunch Unity

 

 

We do not have/use the Document Composition or WorkView modules.  I also have no experience with Unity Scripts, although my colleagues do, and I am interested to know what approach you decide to use. 

 

I hope this helps!

 

Laura

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