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

穿精又带淫゛_ 提交于 2019-12-13 16:17:56

问题


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?


回答1:


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.




回答2:


You have a hidden field already which gets the text only part of the RichText field. That works for new documents or documents which got edited.

Write a formula agent which sets the hidden field to all other documents. It would have a formula

SELECT @All; 
FIELD FieldNameTextOnly := @Abstract([TextOnly]; 2000; ""; "FieldName");
""

and the Target option "All documents in view". Go to the view which contains all 25k documents and start the agent.

Then add a column for your hidden field "FieldNameTextOnly" to your view if you haven't already.

Be a bit careful with the number of characters you want to get from RichText field as those will be part of calculated view so the view might get very large ...



来源:https://stackoverflow.com/questions/26407014/lotus-notes-how-to-show-up-rich-text-field-in-a-view-for-existing-documents

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!