Search code examples
lotus-noteslotusscript

Lotus Notes: How to show up Rich Text Field in a view? For existing documents


I have some Rich Text Fields in a form definition. It is really just Text. I want to show it in a view but cannot find the field when I add a new Column.

I searched a lot and find out that Rich Text cannot be shown up directly in a view.

Then I found this idea to have a hidden field as a computed field with formula defined as @Abstract([TextOnly];60400;"","FieldName")

But this only works if a new document is created or changes are made for a document. I have almost over 25k documents and it is not practical to do that manually.

Is there anyway to make the hidden computed field got recalculated? Or any other way to show a Rich Text Field in a view?


Solution

  • You can write an Agent witch runs over all documents in view with the following code:

    
            Dim session as new notessession
        dim db as notesdatabase
        dim view as notesview
        dim doc as notesdocument
    
        set db = session.currentdatabase
        set view = db.getview("")
        set doc = view.getfirstdocument()
        while not doc is nothing
            Call doc.computewithform(true, false)
            Call doc.save(true,true)
    
            Set doc = view.getnextdocument(doc)
        wend
    
    

    But with running this agent you will change the last modified date of the documents. If it is important to save the date you can write it in an other field and display it.