Hi, I haven’t done any development in Domino since Version 5… so its been awhile.
We have a database where we have a set number of documents for about 20 users. Each user has about 10 to 20 documents per week created for them. Right now, what is done is the previous weeks documents are copy and pasted, and each subject had to be individually edited to change the date to the current week. Time consuming work when there are 20 users and approx 20 documents per person created per week.
What I want to create is that an agent or button that when pressed will prompt for 1) the persons name and then 2) the date of the current week. It will then go out and cross reference the name selected create the 10 to 20 docs specific for this person, and save them with the default subject (previously defined somewhere), and the date entered (in Q2) appended onto the subject - and then save the document.
To finally get to my question - what is the best way to do this? i.e. - would it be a db column lookup or is there something easier now?
Subject: Basic outline of what could be done to resolve your issue
Hi, Rob. You really probably need to use LotusScript for this if you want to create a series of documents from existing documents. You would want to first have a view that has a first column that is the sorted names of the users. In your code to create the new documents prompt the users for the name from a dialoglist of names generated by a lookup(use Evaluate with @dbcolumn)to the sorted view. Once you have the selected name as your key, use a GetAllDocumentsByKey statement to retrieve all the documents into a document collection. Use a while loop to cycle through the collection and for each document create a new document with a Dim As New NotesDocument( notesDatabase ) statement copying over what fields you want from the old document to the new documents and setting the subject to what value you want. I’d advise you go through the Lotus Domino Designer Help database to look at examples of how to do the above. If you study the examples, you should be able to do it.