Another one of those questions

Posted on 2006-05-19
Last Modified: 2013-12-18
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.

Question by:varvoura
    LVL 46

    Expert Comment

    by:Sjef Bosman
    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.

    Author Comment

    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.


    Author Comment

    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?


    Author Comment

    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?
    LVL 46

    Accepted Solution

    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)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

      In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
    Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now