What is the best way to link a document to another document in the same database based on a field value?
For instance I have a document that has a free form Procedure number that the user types in. I would like for another document to link to that document by that number. I could use the DOC ID, but if the procedure happens to be updated and the old one archived it will always point to the procedure that is archive.
I would like for there to be a action button on the user could click and a prompt asks them for the procedure number to link to. Then it would create a button with the appropriate code that would link to that procedure.
Any ideas? Right now I have it where the user have to update the code on the button but that is just not going to work for my non-savvy users.
Why not use the PickListCollection method of the NotesUIWorkspace class?That will return a document collection (can be restricted to one document if you set MultipleSelector argument to False). Point it to a view of all non-archived documents.
Get the procedure number value from the selected document and store that in a hidden field (or visible if you like).
Whenever you need to get a value from the procedure document later, or the user want to open it for soem reson, just use GetDocumentByKey method of the NotesView class to get to the currently active document.
This will work as long as you don’t archive a procedure document without replacing it with a new. You need to add some error handeling for that, perhaps a second lookup to get the archived version if there is no active one.
If the user pick the document with ID 1234, you store that value in a (hidden) field.Your button/hotspot action then uses the value in teh hidden field to open the correct document later.
Subject: but the hotspot/button needs to be inline of text
The hotspot/button will need to be created where ever the user has the cursor and there could be more than one hotspot/button created in a paragraph on different lines.