Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stumped on an Agent I'am writting

Status
Not open for further replies.

BlackHawk2

Technical User
Jan 29, 2002
124
US
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
 
Do you have to use an agent and formula? I've done something similar with LotusScript in the PostSave event of my form.

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(&quot;InterviewLanguage&quot;) = &quot;Other&quot; And source.FieldGetText(&quot;OtherLanguage&quot;) <> &quot;&quot;) Then

notify = &quot;Put Name Here&quot;

Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
If source.document.IsNewNote Then
language = source.FieldGetText(&quot;OtherLanguage&quot;)
docket = source.FieldGetText(&quot;DocketNo&quot;)
fname = source.FieldGetText(&quot;FirstName&quot;)
lname = source.FieldGetText(&quot;LastName&quot;)
intdate = source.FieldGetText(&quot;InterviewDate&quot;)
interviewer = source.FieldGetText(&quot;Interviewer&quot;)

doc.Form = &quot;Memo&quot;
doc.SendTo = notify
doc.Subject = &quot;Translator Needed&quot;

doc.Body = &quot;Case Number: &quot; + docket + &quot;. &quot; + fname + &quot; &quot; + lname + &quot; , interviewed on &quot; + intdate + &quot; by &quot; + interviewer + &quot;, requires a &quot; + language + &quot; translator. Thank you.&quot;

Call doc.Send( False )
Else
Exit Sub
End If
End If
End Sub

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top