Hide Empty Lotus Notes Rich Text Field
This problem is simple: I want to hide the area if there is rich text (RTF), and indicate whether there is something in my case or in the Lotus Notes attached in the RTF field is empty it does not count, though it is empty Hide-When formula such as MyRTF=— will not work and you can only use @Formulas.
Lotus Notes Tutorial Solution
1) Create a new Lotus Notes Numeric field, Computed for Display, Hidden, and with Value set to @ThisValue (or HideMyRTF if you are using an earlier release than ND6) Lets call this field HideMyRTF in this example.
2) Set the Hide-When formula of your existing Rich Text Field – lets call it MyRTF in this example – simply to HideMyRTF (meaning if HideMyRTF is True then hide MyRTF)
3) Add some LotusScript using the NotesRichTextItem EmbeddedObjects property to the Forms QueryOpen event. This will check if there are attachments or text in the field:
Dim rtitem As NotesRichTextItem
Set rtitem = source.Document.GetFirstItem( "MyRTF" )
If Isempty(rtitem.EmbeddedObjects) And Trim(rtitem.Text) = "" Then
source.Document.HideMyRTF = 1
Else
source.Document.HideMyRTF = 0
End If
This was for an existing app that has been around for quite a few years so there is no way for me to control anything from the beginning. I guess I could have used an agent to set some stuff but this would most likely cause tons of replication conflicts as there are tens of thousands of Lotus Notes documents, still being updated by users and replicated across several servers.
It was a long time since I did any Lotus Notes Tutorial so I’m a bit rusty. I’m sure I’ve come up with this or a similar solution in the past but I could not find any when searching so I had to start from the beginning
Viewed 11046 times by 3188 viewers













