Roll-Up Responses

Notes can handle main and response documents, but what if a customer wants to
have all response doc info nicely reported together with main document
That's where script can add tremendous value.

Sub Initialize

'-- This script generates a ReportDoc which includes a subset of the
MAIN document together with available responses--'
'-- Last change: 14-06-1999 - added to the report : complaint_no_1 ,
Date_Created and actions_requested_by_customer
'-- Jaap Steenis
Dim session As New NotesSession
Dim db As NotesDatabase
Dim DateOfToday As NotesDateTime
Set DateOfToday = New NotesDateTime("08/18/1995 01:36:22 PM")
Dim doc As NotesDocument
Dim view As NotesView
Set db=session.CurrentDatabase
Set view = db.GetView( "Pending" )
Dim username As String
username = session.username

Dim ReportDoc As NotesDocument
Dim richText As NotesRichTextItem

Dim rcollection As NotesDocumentCollection

Dim rt As NotesRichTextItem
Set doc=view.GetFirstDocument
Do While Not(doc Is Nothing)
If doc.Form(0) = "FM001" And Instr(username, doc.Country_Code(0)) >
0 Then
' Messagebox("Document Number") &doc.complaint_no(0)
Set ReportDoc = New NotesDocument( db )
Set richText = New NotesRichTextItem(ReportDoc,"Body")
Call richText.AppendText("COFI DETAILS")
Call richText.AddTab(1)
Call richText.AppendText("CONSOLIDATION DATE :")
Call richText.AppendText(Cstr(ReportDoc.Created))
Call richText.AddNewLine(2)
Call richText.AppendText("Customer :")
Call richText.AppendText(doc.name(0))
Call richText.AddNewLine(1)
Call richText.AppendText("Product :")
Call richText.AppendText(doc.product_Code(0))
Call richText.AppendText(" - Batch :")
Call richText.AppendText(doc.batch_no(0))
Call richText.AppendText(" - Order No :")
Call richText.AppendText(doc.Order_no(0))
Call richText.AppendText(" - Packaging Type :")
Call richText.AppendText(doc.Package_Code_Ds(0))
Call richText.AddNewLine(1)
Call richText.AppendText("Size of delivery : ")
Call richText.AppendText(Cstr(doc.size_of_delivery(0)))
Call richText.AppendText(" Kg")
Call richText.AppendText(" - Delivering-Invoicing Site : ")
Call richText.AppendText(doc.manufacturing_company(0))
Call richText.AppendText(" - Delivery date: ")
Call richText.AppendText(Cstr(doc.delivery_dt(0)))
Call richText.AddNewLine(2)
Call richText.AppendText("Raised on : ")
Call richText.AppendText(Cstr(doc.complaint_raised_dt(0)))
Call richText.AppendText(" - Created on : ")
Call richText.AppendText(Cstr(doc.complaint_dt(0)))
Call richText.AppendText(" - Initiator: ")
Call richText.AppendText(doc.initiator(0))
Call richText.AddNewLine(2)
Call richText.AppendText("COFI DESCRIPTION :")
Call richText.AddNewLine(2)
Call richText.AppendText(doc.description(0))
Call richText.AddNewLine(2)
Call richText.AppendText("ACTIONS REQUESTED BY CUSTOMER : ")
Call richText.AddNewLine(2)
Call richText.AppendText(doc.actions_requested_by_customer(0))
Call richText.AddNewLine(2)
Set rcollection = doc.Responses
Set rdoc=rcollection.getfirstdocument
Do While Not (rdoc Is Nothing)
Set rt=rdoc.getfirstitem("Body")
Call richText.AddNewLine(1)
richText.AppendText("------------------------------------ COMMENTS AREA BELOW
Call richText.AddNewLine(1)
Call richText.AppendText("From: ")
Call richText.AddTab(1)

This was first published in November 2000

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.