Q

Creating a rich-text field in Lotus Domino that only accepts doclinks

SearchDomino.com expert Cregg Hardwick explains several options for creating a rich-text field in Lotus Domino that only allows doclinks.

Can we validate a rich-text field in Lotus Domino to only have doclinks?

VIEW MEMBER FEEDBACK TO THIS ASK THE EXPERT Q&A.

Not directly, but you can control what gets into the rich-text field to begin with. In Lotus Domino R6 you can create a "Rich Text Light" field that only accepts doclinks. In Lotus Domino R5, you could use a hide-when formula to conceal your rich-text field and provide a button for adding doclinks to it using the LotusScript "AppendDocLink" method of NotesRichTextItem. If the Lotus Notes user has no other way to put anything is the field, it can only contain doclinks.

The trouble with validating what's already in the field is that the only programmatic way to see what's in the field is to call NotesRichTextItem's "GetFormattedText" method. Depending on your situation, this might be sufficient, but it won't let you detect images or other rich-text content.

You might be able to get somewhere by using the DXLExporter to dump the Lotus Notes document to XML and then parse through it for the field in question. If that doesn't work, there's always the Midas Rich Text Toolkit from GenniSoft.

MEMBER FEEDBACK TO THIS ASK THE EXPERT Q&A:

Part of Cregg Hardwick's response was: "In Lotus Domino R6 you can create a 'Rich Text Light' field that only accepts doclinks."

Maybe I'm missing something, but I don't see doclinks as one of the choices in a Rich Text Light field, nor would I equate any of the available choices to being doclinks. Am I missing something?
—Micky R.

******************************************

I was wrong. It is not possible to place a doclink in a "Rich Text Light" field. The rest of my comments are still valid though. The best approach is to control what gets into the field in the first place, by only allowing programmatic updates to the rich-text field. The RichTextItem class has methods for adding any kind of Lotus Notes doclink.

Once you have extant data that you want to validate, however, it gets much harder. I think the best bet is to dump the document in question to XML -- using the DXLexport, and parse the resulting file to find the rich-text field. I have not tried this specifically, but I believe DXL now has full support for rich-text content -- in Lotus Domino R5 it did not. Unfortunately, I don't have time to work through this, and using the DXL functions are non-trivial. So depending on the application, this might or might not be practical.
—Cregg Hardwick, LotusScript Expert

Do you have comments on this Ask the Expert Q&A? Let us know.

Related information from SearchDomino.com:

  • Learning Guide: LotusScript development
  • FAQ: LotusScript advice
  • Reference Center: LotusScript tips and resources
  • This was first published in September 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.

    0 comments

    Oldest 

    Forgot Password?

    No problem! Submit your e-mail address below. We'll send you an email containing your password.

    Your password has been sent to:

    -ADS BY GOOGLE

    SearchWinIT

    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 ...

    SearchEnterpriseLinux

    SearchVirtualDataCentre.co.UK

    Close