Another one of those questions

Hi all,

Please take a look at the following scenario:

I have a database which has 3 forms.

Form 1 (Main Form) - Customer form
Form 2(Response Form) - Product form
Form 3(Response to Response Form) - Test form

Only one main customer document is created for each customer, however, for each customer many response product documents can be created and for each product many response to response test documents can be created.

To start using this db, we will be importing all the customer list, then at random, someone will start entering each product for each customer into the database.

What I need to do is the following:

Create an scheduled agent to run, everytime this agent checks to see if a newly entered product has a response test document, if not, to create a response to response test document and populate in it only those inheritence fields from the newly created response document. When the first response to response document(first test document for each product) exist in the database, it will then help us to schedule new test schedules based on dates set on it and then the engineer will create additional tests documents based on those schedules.

In short, is there a way to create an agent to run and test if a new product document has been created and created an initial test document for it?

Keep in mind that the initial test document is a response to response document of product? how would you create that in lotusscript.
I know that you can easily create a response to main, but i am not sure if you can use the same structure to create a response to a response document/

Thank you all in advance

P.S. I can see your 10 YEARS celebration logo on the page.

Who is Participating?
Sjef BosmanConnect With a Mentor Groupware ConsultantCommented:
1) yes
1a) Hm, import, that's a totally different ballgame. You'd have to write a separate agent to do that, because you have to search the Customer, then create the Product and then the first Test document.
3) IMHO it is not a property of a test when the next test is to be done, but the property of a Product. Logically speaking...

4) To create a Test-document, do the following:
    - it MUST be in the PostSave, because the Product document has to be there
    - in the QuerySave, you need to save a variable that tells the PostSave that it was in fact a new document
    - code like (you do the Dim's):
        Set rrdoc= New NotesDocument(db)
        Call rrdoc.MakeResponse(rdoc) ' assuming rdoc is the current Product document
        Call rrdoc.ReplaceItemValue("Form", "Test")
        Call rrdoc.ReplaceItemValue("SomeField", rdoc.SomeField) ' copy the fields you need
        Call rrdoc.Save(True, False)
Sjef BosmanGroupware ConsultantCommented:
With respect to main and response document: there are only two types of documents, a document that has a parent and a document that has no parent. A document with a parent is a response document (or a response-to-response or response-to-response-to-response document). Creating a response document from LotusScript isn't very difficult.

Now about your agent. Why do you need it? Wouldn't it be easier to create the first Test-document the moment the Product document is saved?

About the scheduling: why don't you add a field in the Product document that contains a date and an interval? Whenever a test is completed, a new test date is calculated based on the date and the interval, and a new (empty) Test document is generated.
varvouraAuthor Commented:
Great, I am glad you understood exactly what I want, if I create a new product, i want when it is saved to create an initial test document which inherits the fields required from the product document and, yup and the idea of interval is great, I am implementing this on the test form, but I'll clarify with you whether it is best to use on product form. But first, let's takle these one at the time.

1) How can that be done? should I write a querysave script to check whether or not a new doc and then create the response?

What happens if my manager decided to give me a list of thousands products per customer to import in, then i'll need the agent, wouldn't i? as the product may need to be imported from the list?

2) I am doing the scheduling on the test form, where I am setting intervals and test due dates, when these due dates are reached a notification is sent to responsible person, but how would I go about creating a blank test document when the schedule is reached(this bit may not be necessary as my manager may request that the engineers will create their own test documents after the initial one) however, I'll have to clarify.

varvouraAuthor Commented:
one more thing:

While creating the response to response document, it is easy to create those field which inherits from response doc, what about all these additional fields that I need to add on response to response doc which are not on the response doc.
Do I need the structure of


Before saving the doc?
Would that work?

varvouraAuthor Commented:
I was able to create the response document on save, thank you.

Do you think having the schedule set on the test document will work, or do you think that it is best to use them on product doc?
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.