Stumped on an Agent I'am writting
Stumped on an Agent I'am writting
(OP)
I am trying to write an Agent in Domino Designer using Formula. I think I am running in the wrong direction.
I have a form with 6 fields. Field A, B, C, and D and also 1 and 2. If field A (which is a date) is less than todays date I want an e-mail to be sent to me with the contents of Field C.
Also the same with field B(a date) and Field D to be added into the e-mail.
But if Field 1 is Checked (a checkbox with the value of Yes) then I do not want Field C to be in the e-mail body.
Likewise with field 2, if it is checked field D should not be in the body.
BUT if none of the fields A or B comes before todays date I want no e-mail sent.
Hope this was descriptive enough and that someone can point me in the right direction.
BH2
I have a form with 6 fields. Field A, B, C, and D and also 1 and 2. If field A (which is a date) is less than todays date I want an e-mail to be sent to me with the contents of Field C.
Also the same with field B(a date) and Field D to be added into the e-mail.
But if Field 1 is Checked (a checkbox with the value of Yes) then I do not want Field C to be in the e-mail body.
Likewise with field 2, if it is checked field D should not be in the body.
BUT if none of the fields A or B comes before todays date I want no e-mail sent.
Hope this was descriptive enough and that someone can point me in the right direction.
BH2
RE: Stumped on an Agent I'am writting
So something along these lines (obviously not "real" code, but enough to get the idea):
Sub Postsave(Source As Notesuidocument)
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim language As String, docket As String, fname As String, lname As String, interveiwer As String, notify As String
Dim Comments As String
Dim intdate As Variant
If (source.FieldGetText("InterviewLanguage") = "Other" And source.FieldGetText("OtherLanguage") <> "") Then
notify = "Put Name Here"
Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
If source.document.IsNewNote Then
language = source.FieldGetText("OtherLanguage")
docket = source.FieldGetText("DocketNo")
fname = source.FieldGetText("FirstName")
lname = source.FieldGetText("LastName")
intdate = source.FieldGetText("InterviewDate")
interviewer = source.FieldGetText("Interviewer")
doc.Form = "Memo"
doc.SendTo = notify
doc.Subject = "Translator Needed"
doc.Body = "Case Number: " + docket + ". " + fname + " " + lname + " , interviewed on " + intdate + " by " + interviewer + ", requires a " + language + " translator. Thank you."
Call doc.Send( False )
Else
Exit Sub
End If
End If
End Sub
Hope this helps!