Notes doesn't like hide - unhide attachments. Part 2

I closed a question yesterday because I thought it's ready.

It's working the right way, I hide the attachment with a subform. If the subform is loaded the attachment is visible otherwise not.

But how surprised I was when I looked through the Form, today and realised that at the bottom of every request there's the attachment as well!!!

The program appends the attachments to the Request Form. The attachment's icon is grey like when I open an Excel 2000 and select File - Send To - Mail recipient. (then the icon will be pasted into a memo and the icon is grey)

I did a big effort to hide the attachment and now, the system append it a second time.
I double checked and the place where the attachment appears at the bottom, there is no field in the designer.

How can I get rid from the unwanted attachment at the bottom?
didier20Asked:
Who is Participating?
 
marilyngCommented:
Ok, haven't done this in awhile, so I tested.

Created two subforms, one HasAttachments, the other, NoAttachments

HasAttachments as your editable, rich text field

NoAttachments has
>>>ATTACHMENT HIDDEN<<< (RED, NO HIDE WHEN'S CHECKED)
Section, collapsed for everything.
In the section is your rich text field
Your rich text field make computed, = to itself.

select everything from the line above the section to the line below the section, and check off the Hide when properties..

-------

On your main form, insert the subform based on computed formula.
For test I put a single field, ShowAttachments Yes/No  (Default= "Yes")

---
Create a form, add an attachment.  Save the form, ctrl+s, change the showattachments to No.  Close and reopen.  Attachments gone. (but not from view if you have a column)  But with the Show Attachments, you can also calculate if you want to show the attachment.



0
 
Sjef BosmanGroupware ConsultantCommented:
Let me post my links again:
    http://www-1.ibm.com/support/docview.wss?rs=0&uid=swg21085155
    http://www-1.ibm.com/support/docview.wss?rs=0&uid=swg21099682

From the first one:
In Domino/Notes 4.6 and later, there is an internal field named "$V2AttachmentOptions" that can be added anywhere to the form. If this field has a value of "0" (a text zero), then all V2 Style file attachments will be hidden from Web clients. Notes clients will still be able to see the attachments. The field should be of the type Text and can be Editable, Computed or Computed for Display as desired. Note: If setting this field via a formula or agent be sure that the it is set to a text value of "0", see the Troubleshooting section below for additional details.
0
 
mbonaciCommented:
Hi didier20,
Does your form have a Body field?
If not, the attachment will appear at the bottom.

You can create the Body field like this:
    Set rti = New NotesRichTextItem( yourDoc, "Body" )

The Notes does not know where to display the attachment.


Hope this helps,
Marko
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
didier20Author Commented:

sjef,

The first links says following:
"$V2AttachmentOptions field. Right-click the document and select the Document Properties and then the second tab, and then highlight the field in the list."

There's no $V2AttachmentOptions field just these:
$EncryptionStatus
$FILE
$Revisions
$SignatureStatus
$UpdatedBy

The second links (Computed Subform and Controlled Access Section) I tried hours long yesterday.

Computed Subform: I use this and it works but there's the attachment at the bottom.

Controlled Access Section: When I select auto-collapse section for Non Editors, the section is auto-collapsed when the document is opened BUT the non editor can expand it and see the attachment. He can't edit or delete it but he can read it and that's what I want to hinder.
0
 
marilyngCommented:
didier20,  the $V2AttachmentOptions  only works on WEB clients.

Please try my suggestion, I did test and it does work.
0
 
didier20Author Commented:
mbonaci,

You've said that Notes does not know where to display the attachment.

But there's the Rich Text Field and Lotus displays the attachment in that field!
But lotus displays a duplicate at the bottom, too!

Where should I create a Body field, on the Form or on the Subform?
Where should I enter the Code  Set rti = New NotesRichTextItem( yourDoc, "Body" )?


0
 
marilyngCommented:
the section is auto-collapsed when the document is opened BUT the non editor can expand it and see the attachment. He can't edit or delete it but he can read it and that's what I want to hinder<< Hide the section on this subform.  :)
0
 
didier20Author Commented:
marilyng,
 You wrote:
Create a form, add an attachment.  Save the form, ctrl+s, change the showattachments to No.  Close and reopen.  Attachments gone. (but not from view if you have a column)  But with the Show Attachments, you can also calculate if you want to show the attachment.


Is the ShowAttachments field a dialog list and editable?
But what's the connection between the ShowAttachments field and the attachment?

If I create an editable field with default value "Yes" that doesn't has an effect on the subform if the subform displays the attachment or not.
There should be a formula like
@If(ShowAttachments="No";AttachmentPlace=""";AttachmentPlace";)
or not?

AttachmentPlace is the field on the subform that displays the attachment.
0
 
marilyngCommented:
Showattachments for my test was a dialog list that I could set to Yes or No.  You can change this to a formula that you calculate whenever you want to change if the attachment appears or not.


The formula for the subform can be based on the showattachments field or some field on your form.  I just told you how to recreate my experiment. :)

The point was:

one subform has the attachment field available, editable with no hide-whens.

The second subform nests the attachment in a closed section, and all the lines of that section, including the rich text field is hidden.  The rich text field in this part is computed with the formula = to itself.

The formula you use to display which variety of the subform is up to you.


0
 
didier20Author Commented:
I got rid from the attachment at the bottom.

I've a mainform A and this has two subforms B and C (only one subform is displayed at the same time depending on a Formula)
Furthermore, B has two subforms (HasAttachment and HasNotAttachment)

I tested where to place the hidden Section and found that when I create it on the HasNotAttachment subform, the duplicated attachment is still at the bottom.

I placed it at the B subform and the attachment at the bottom was gone.
0
 
marilyngCommented:
good for you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.