Hello All
I need some assitance with the following script.
What I would like the Messagebox to show is
If doc.approver_1(0) <> "" Then emailDoc.CopyTo = doc.RequesterName(0) is true then show that and Sendpeople in a messagebox , if not true then show only the Sendpeople value. I think this will require two messagebox statements I am not sure how to write it.
Also with my error handling I will need to show the same values as above. I am not sure about the placement of the On Error Goto ErrorSending within this script. Is there any way to test the error handling
Regards
James
I need some assitance with the following script.
What I would like the Messagebox to show is
If doc.approver_1(0) <> "" Then emailDoc.CopyTo = doc.RequesterName(0) is true then show that and Sendpeople in a messagebox , if not true then show only the Sendpeople value. I think this will require two messagebox statements I am not sure how to write it.
Also with my error handling I will need to show the same values as above. I am not sure about the placement of the On Error Goto ErrorSending within this script. Is there any way to test the error handling
Regards
James
Code:
Print "SendingNotification"
PromptTitle = doc.PromptTitle
Stop
Dim emailDoc As New NotesDocument( db )
'Set some fields on the document
doc.FormStatus = "RAP"
doc.DocStatus = "Waiting for Coordinator"
doc.StatusApp = "Approval Complete"
doc.ACoorDate1= Date
doc.CoordSubmit = "Sent"
'E-mail those who need to know
emailDoc.Form = "Memo"
emailDoc.SendTo = doc.Coordinator(0)
If doc.approver_1(0) <> "" Then emailDoc.CopyTo = doc.RequesterName(0)
emailDoc.BlindCopyTo = ""
emailDoc.Subject = doc.PDI_ID(0) & "is waiting for your action. Approval is complete"
'Create the body field and put in a doclink
Set rtitem = New NotesRichTextItem(emailDoc, "Body")
Call rtitem.AppendDocLink(doc, "Link to document")
'Compute the computed fields
Call emailDoc.ComputeWithForm(False, False)
'Send the e-mail
Call emailDoc.Send (False)
On Error Goto ErrorSending
Messagebox "Notification has been sent to " & doc.Coordinator(0) +". " + doc.RequesterName(0) & ".", 0 + 64, PromptTitle(0)
Exit Sub
ErrorSending:
Messagebox "FYI: " & doc.Coordinator(0) +". " +doc.RequesterName(0) & " could not be notified via email at this time.", 0 + 64, PromptTitle(0)
Exit Sub
End Sub