In a response document a “Show main” button should open the main document or in case an instance of the main document is already open switch to the window of it.
wich sure enough opens the parent document. But any time one press the button a new instance is created. And I cannot find a way to get information about currently open windows to avoid this.
Subject: How to avoid multiple instances of one document to be shown in the UI
Notes supports this natively - create a text field with the formula @InheritedDocumentUniqueID in a TEXT field not a RT field - notes will automatically create this as a doclink to the parent for you.
Subject: $Ref works - @InheritedDocumentUniqueID not
Thank you Alan,
you’re right. Only that I now want something more visible than the small doclink icon.
By the way:
Using $Ref works fine, but @InheritedDocumentUniqueID not. Isn’t that strange. The Link-Properties look the same…
And it is the same for RTF or TEXT…
As my response document already contains a subject line of the parent document (for the users orientation), I thought I make this a doclink. Therefor I appended a doclink to the appropriate RTF in the PostOpen event.
Accessing the doclink in the same event is ok.
But nothing happens when the user clicks on the doclink text. It really looks like a doclink: Blue text with a blinking under-line.
Using FindFirstElement(RTELEM_TYPE_DOCLINK)in an Action-Button fails.
Subject: but still the same problem - for each click a new instance of the doc will be created
I ended in providing the doclink icon in paranthesis just after the subject line referencing the parent document.If a user complains about the possible multiple windows for one document (wich I doubt) I will blame IBM.
Subject: RE: but still the same problem - for each click a new instance of the doc will be created
if you just want to prevent users clicking the “open parent” button more than once, set a hide-when formula on it that is triggered once the button is clicked. Very kludge-y, but if you really need to prevent – or at least discourage – such behaviour, that will do. As for what you reference in your hide-when, up to you. I would suggest a temporary environment variable that is removed when the user closes the response doc.
Subject: RE: but still the same problem - for each click a new instance of the doc will be created
I thought about both options before.
Using a hide when formula the user can open the parent doc only one time. If he close it and then want to have another look, the doclink is gone.
Using an enviroment variable seems to be the better option. But if Notes crashes, the variable will be still there and the respective document will not open anymore.
Hmmm, just a new idea, the application could do some housekeeping at startup…