1

How to hide an attachment in a Lotus Notes document pasted in a rich text field? Using attach icon the attachment can be hidden using hide-when formula !@IsNewDoc, if it is pasted it remains visible even in case of the same hide when formula. (Lotus Notes 8.5.3 client) After saving and reopening the document, the attachment is still displayed. (Is seems @isnewdoc does not work)

Jozsef Lehocz
  • 330
  • 3
  • 21

3 Answers3

5

It does work the way you described BUT after setting hide-when formula you have to close and reopen the document because the formula !@IsNewDoc hides the attachment only if document is not new.

Even if you edit an existing document you have to

  • press F9 or
  • select menu View/Refresh

after setting hide-when formula. The hide-when formula doesn't work right away. The document has to be recalculated before hide-when formula takes affect.

EDIT:

You have a form with a RichText field. This has a hide-when formula !@IsNewDoc. Normally, all content disappears when document is saved and reopened. But, if user copies an attachment from another Notes document's Richtext field the attachment stays visible.

Why? If you copy an attachment from another RichText field then not only the attachment is copied but also all properties. In this case the property hide-when is empty for copied attachment.

Here is a solution:

  1. Create a subform "AttachmentsNewDoc" with RichText field without any hide-when formula.
  2. Create a subform "AttachmentsExistingDoc" with RichText field inside a collapsed section with hide-when formula 1.
  3. Include in your form a calculated subform with formula @If(@IsNewDoc; "AttachmentsNewDoc"; "AttachmentsExistingDoc")
Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67
  • unfortunately after saving, closing and reopening the document the attachment is still displayed. (I have corrected the original question as well.) – Jozsef Lehocz Nov 15 '13 at 07:24
  • For me does it work in 8.5.3 client: I open a new mail, choose an attachment, set the hide-when formula, save, close and reopen the document - the attachment is invisible. Did you try the hide-when formula `1` too? – Knut Herrmann Nov 15 '13 at 07:29
  • I would like to create a form, where attachments are not displayed after saving the new document.So asking the users to set the hide-when every time they create a new document can not be an option. The attachment should be pasted instead of attaching. – Jozsef Lehocz Nov 15 '13 at 07:33
  • OK, I understand. Set the hide-when formula `!@IsNewDoc ` for the RichText field in form. Then the user can attach files when document is new. After saving and reopening the document the complete RichText field is invisible and so the attachments. – Knut Herrmann Nov 15 '13 at 07:44
  • Yes. The hide when works, if the user attaches the files. The hide when does not work, if the user copies an attachment from another document and pastes it there. In this case after saving, closing and opening the document, the pasted attachments are still displayed. – Jozsef Lehocz Nov 15 '13 at 07:55
  • 1
    That is true. If you copy an attachment from another RichText field then not only the attachment is copied but also all properties. In this case the property hide-when is empty. That's why you have to set the hide-when formula again for copied attachment. – Knut Herrmann Nov 15 '13 at 08:00
  • 1
    Put the RichText field in a subform. Compute the subform with `@IsNewDoc`. This way you don't depend on hide-when formula of elements in RichText field. – Knut Herrmann Nov 15 '13 at 08:06
  • I have not thought that the hide-when is also copied. Creating a computed subform can also be a good solution, I will use that. Thank you. – Jozsef Lehocz Nov 15 '13 at 08:23
  • Using the computed subform the rich text field is not displayed, but the attachments are displayed at the bottom of the document under a horizontal line, even if I add a $V2AttachmentOptions field with a "0" value. – Jozsef Lehocz Nov 15 '13 at 09:10
  • I added a solution for your case to my answer. Hope it works finally :) – Knut Herrmann Nov 15 '13 at 10:02
  • 1
    Just to clarify Knut's answer: do NOT Hide the Richtext- Item itself with any Hide- When- Formula, but set the section to "AutoCollapse" and hide the section header. If you hide the Richtext- Item itself you will again get the $V2Attachment at the bottom of the document... $V2AttachmentOptions only works in web- applications – Tode Nov 15 '13 at 16:37
  • Yes, it is clear now, and working as described. Thank you for the help. – Jozsef Lehocz Nov 18 '13 at 14:42
0

Rich Text fields can not normally be hidden. The rich text itself can contain hide-when formatting. So you have to use a work-around if you need/want to hide the attachments. I would use the computed subform trick for this.

Karl-Henry Martinsson
  • 2,770
  • 15
  • 25
0

Yes, for documents already saved, you need to go to the richtext field and check all items (files) to make sure the hide when on these are set correctly.

J Doe
  • 19
  • 6