I use the rtitem.appenddoclink method in LotusScript. How can I create and save a $Links field in the back end?
Readers should be able to trigger doc updates via an agent that runs on the Lotus Domino server. It works fine until you reopen the doc without running the script (the script shouldn't be run if nothing has changed in the source database). The doclinks are then lost and converted to dblinks, because the $Links field was never created and saved in the Unique Identifier after the LotusScript agent was run.
Can you please help me solve this?
I would have to see your code to understand what you are trying to do. You cannot create a $Links field directly. This is a reserved field that is created by Lotus Notes when you add doc links to a rich-text field.
It's not clear why this process is not working, nor why the doclinks are "Converted to dblinks". I don't recall having experienced that behavior. The only way I have seen AppendDocLink fail either raises an error at runtime, when the user clicks the link, or both.
So without seeing your LotusScript code, I can only point out the following caveats:
- Make certain that both Lotus Notes databases have a default form and view. doclinks can fail in a number of ways if this is not true.
- Prior to Lotus Domino R7, no changes to a rich-text field are visible in the UI until the document is saved, closed, and reopened. I doubt this is an issue here.
- Verify that the "linkto" object you are passing to the AppendDocLink method is, in fact, a document. Since I have never seen a link fail in any way that does not raise an error, my guess would be that your LotusScript agent has a bug and is linking to the Lotus Notes database instead of the intended document. Because the method is not type-safe, this wouldn't raise any alarm bells.
Do you have comments on this Ask the Expert Q&A? Let us know.
Related information from SearchDomino.com:
Dig Deeper on LotusScript
Related Q&A from Cregg Hardwick
A user wants to know if it's possible for LotusScript to read an attachment in a Notes document without first detaching it. Find out our expert's ... Continue Reading
Learn about different options using LotusScript code and Formula language to customize the principal field of outgoing Lotus Notes email messages. Continue Reading
Read about merging cells in a Microsoft Word table using LotusScript and an Excel example, along with the thought process that goes along with it. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.