Q
Problem solve Get help with specific problems with your technologies, process and projects.

Creating and saving a $Links field in the back end

SearchDomino.com expert Cregg Hardwick offers advice to a Lotus Notes developer trying to create and save a $Links field, and explains potential reasons for doclink failures.

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:

  • Learning Guide: LotusScript
  • FAQ: LotusScript
  • Reference Center: LotusScript tips and resources
  • This was last published in August 2006

    Dig Deeper on LotusScript

    Have a question for an expert?

    Please add a title for your question

    Get answers from a TechTarget expert on whatever's puzzling you.

    You will be able to add details on the next page.

    Start the conversation

    Send me notifications when other members comment.

    By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

    Please create a username to comment.

    -ADS BY GOOGLE

    SearchWindowsServer

    Search400

    • iSeries tutorials

      Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

    • V6R1 upgrade planning checklist

      When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

    • Connecting multiple iSeries systems through DDM

      Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

    SearchDataCenter

    SearchExchange

    SearchContentManagement

    Close