Picture in Rich Text Field - Hiding and evaluating for view

I am trying to do two things with a picture in a rich text field.The form is a profile form that includes a photograph.

  1. I need to hide the photograph from all people that are not in the correct UserRole.

  2. I need to indicate in a view whether or not there is a photograph in the document.

Are either of these possible?

Here are the ways I have tried to hide the photograph:

1)I have tried to hide the field. Failure.

2)I have tried to put the field in a section and hide the section. Failure.

Here are the ways I have tried to indicate whether there is a photograph in the doc at the view level:

1)I used the @If(Photograph=“”;“”;“Photograph”) on the column. It just returns “” for all the docs.

2)I used the same @If statement as above in another field in the document and trying to display the contents of that field in the view. The field populates all documents with “Photograph” and still nothing shows up in the view.

Please help!

Subject: Picture in Rich Text Field - Hiding and evaluating for view

1)I have tried to hide the field. Failure.> 2)I have tried to put the field in a section and hide the section. Failure.

Either or both of these should (probably) work. What’s the formula you’re using?

1)I used the @If(Photograph=“”;“”;“Photograph”) on the column.

Won’t work. In fact, nothing with @formulas will work. Rich text fields don’t play well with @formulas, and you won’t be able to get this information (easily) by referring directly to the field. There are a few ways of dealing with this, though none of which are infallable.

An easy-for-you way of doing it is by throwing in a checkbox for users to indicate whether or not they’ve attached a photograph. Have your view look at that field. The problem there, of course, is that users won’t fill in the field.

A harder-for-you but potentially less error-prone method involves using LotusScript in the form’s QuerySave event. Look up the NotesEmbeddedObject class in the help. You can use that to determine whether or not there are any embedded objects in a given RTF. If there are, you can automatically set a hidden field in the background and use that in your view.

Subject: A couple of things…

First is that any hide formula you apply to the form now will not affect existing documents. This formula should work. You will have to edit any existing document and apply the formula in the RT properties of the field.

@If(@IsDocBeingEdited; @False; @IsMember(“[seepics]”; @UserRoles; @False; @True)

For you second problem, some LS code in the Querysave event of the form…

Dim doc As NotesDocument

Dim item As NotesItem

Set doc = Source.Document

Set item = doc.GetFirstItem(“YourPictureField”)

If item.ValueLength > 120 Then 'somewhat arbitrary, check one with blank field vs one with picture

doc.HasPicture = “Y”

Else

doc.HasPicture = “N”

End If