I have an application that is accessed via the web and notes. I have two rich text fields on my form, body1 and body2. I have 2 problems:
1)I have a file upload control with a table below that lists all file attachments created using @AttachmentNames. It groups all attachments in the table. But I don’t want it to show attachments for body2, just body1 since the file upload is only for attaching docs related to body1. Attachments for body2 are attached by Notes clients only. How can I differentiate between the two fields using @AttachmentNames? Is it possible? The file upload uses the table to attach/delete multiple attachments on the document.
- If a web browser opens the doc created by the Notes client and edits it, the attachments end up at the bottom of the page as if they were uploaded through the web. I know I can write Lotusscript to detach and copy them back. But how will I know which attachment goes back to which rich text field?
Subject: File Upload and Attachments Question
Maybe you can have 2 save buttons as well…one of which is hidden from the web. Use javascript on the click of the Save button from the web to calculate the names of the attachments added. Does that work for u ?
Subject: RE: File Upload and Attachments Question
I actually do have 2 save buttons. One is for the Notes clients to attach docs. I’m a newbie when it comes to javascript though. Could you help get me started?
Subject: RE: File Upload and Attachments Question
ill try n get u started…
Algorithm >
-
On the click of the save button, the FileUpload.value will give you the name of the attachment just uploaded.(through the web).
-
(Optional…but will help) Append it to a hidden field (Have a hidden text field to store the names of all the web attachments…and similarly another one to store the names of all teh notes attachments)
-
Use lotus-script to embed the object into the appropriate rich text field
-
Use Lotus hide-when formulae to display the rich text fields.
Does that make sense ?
Subject: RE: File Upload and Attachments Question
I think I’ve got it. But how do I still hide the existing attachments already in the rich text fields when I open the doc on the web? They still get listed because I use @AttachmentNames.
Subject: RE: File Upload and Attachments Question
I understand what to do now. I’ll have the table pull the values from the hidden fields instead of using @AttachmentNames. I’m stuck on Number 2 though. How would I extract the file names for each rich text field doc and web attached doc without getting them mixed together?
Subject: RE: File Upload and Attachments Question
The code for extraction will be on different buttons and stored in different fields…so wont get mixed up. i know tht u can extract the value of the file upload in javascript and you will get the attachment name…cant think rite out the top of my head on how to achieve the same in notes…but im sure there will be a way
Subject: RE: File Upload and Attachments Question
Could you provide the code for the javascript? I can at least add that for the button on the web.
Subject: RE: File Upload and Attachments Question
document.forms[0].FileUploadControl.value will give you the entire absolute path. you are particularly interested in the filename. use substr or substring to extract the string from the right till u hit a “/”…this will be the filename only
Subject: Thanks Pooja for all your help!