Attach document to selected documents in a view

Hi all,I am trying to achieve the following in the notes client. I am relatively new to notes development and I need to check if the following is possible.

I have a view called “sales”. This view contains a categorised list of sales people in my organisation. I would like to select several sales people in the view and then click an action button which will present a list of previously made sales documents. When I have selected a document it will be listed under each selected sales person. I have tried to show this in the diagram below:

John

—sales document5

Anne

—Sales document1

Mary

—Sales document5

Is there an easy way to achieve this? All suggestions are most welcome

Thank you

Subject: attach document to selected documents in a view

What do you mean by this statement: “When I have selected a document it will be listed under each selected sales person.”

By “document” do you mean a NOTES document (a record in an relational database) or a word processing/spreadsheet/other document that will be a file attachment?

If you want to attach the same file to multiple documents, you can do this using LotusScript in an action or agent which loops through the selected Notes documents and uses the RichTextItem class to attach the file to the rtf field on the document.

Look at the NotesUIView, NotesView, NotesDocument, NotesItem, and NotesRichTextItem classes.

Having said that, do you REALLY need these attachments placed on each document? If you do this, multiple copies of the attachment will be stored. Depending on your needs, it may be preferrable to create one attachment document, place the attachment on it, and then in each sales person document, create a link to the attachment document. That way, each sales person can open/download the attachment from the document and only one copy of the attachment is stored.

Subject: RE: attach document to selected documents in a view

“When I have selected a document it will be listed under each selected sales person.” Apologies I should have made this more clear. I mean a Notes document and not a file attachment. Thank you for your advice.

Subject: RE: attach document to selected documents in a view

First, realize that documents in a view show up based on selection criteria for the view. That’s it. You want to make sure the document is currently in the view. If it is, then you will want to update the field on the document that corresponds to the categorized column in the view (the sales person). This field should be a multi-value field and the view should be categorized on this field. When you need to change the sales person, or add or remove, show your dialog, then update that field and save the document.

If the documents you are choosing from do NOT currently meet the selection criteria (ie: they exist in another view, but not the on you need them in) you will need to modify the document fields further in your code so that they meet the selection criteria for the view (thus placing them in the view). If this is the case, I believe you will need to issue a uiview.Refresh() at the end of your code to make them show up without leaving the view and coming back in.