Sub Initialize |
Dim session As New NotesSession |
Dim docSubmit As NotesDocument |
Dim varDocUNID As Variant |
Dim docSelected As NotesDocument |
Dim total As Double |
Dim db As NotesDatabase |
total = 0 |
'Get the document that was submitted with the embedded form |
Set docSubmit = session.DocumentContext |
Set db = docSubmit.ParentDatabase |
|
'Setup the web page's font |
Print |<font face="Verdana">| |
|
'Get the field that contains the UNID's of the selected documents (array) |
varDocUNID = docSubmit.GetItemValue("$$SelectDoc") |
|
'Make sure that at least one document was selected |
If varDocUNID(0) = "" And Ubound(varDocUNID) = 0 Then |
Print "No documents were selected.<BR>" |
Else |
Print "The customer orders you selected were: <BR><BR>" |
|
'Loop through all the documents that were selected |
Forall unid In varDocUNID |
Set docSelected = db.GetDocumentByUNID(unid) |
If Not docSelected Is Nothing Then |
Print docSelected.Customer(0) & "<BR>" |
total = total + docSelected.OrderTotal(0) |
End If |
End Forall |
|
'Print the total of the selected orders |
Print "<BR><BR>" |
Print "Total of the orders selected was " & Format(total,"Currency") |
End If |
'Add a button to return to the view |
Print "<BR><BR>" |
Print |<Center><input type="button" value="Return to view" onClick="history.back();"></Center>| |
Print |</Font>| |
End Sub |