Manage Learn to apply best practices and optimize your operations.

Send Task For To Do List

For those users of your applications that use the Notes To Do List, why not
send them a task instead of just a plain e-mail? This function allows you to
send them a task that shows up in their Inbox, but also in their To Do List.
Great for apps where supervisors delegate responsibility.
Function SendTask(assignedto As String, subject As String, startdate As
Variant, duedate As Variant, _
body As String, copyto As String, import As Variant, linkto As notesdocument)
As Integer
'This function sends a Notes' TASK to the person listed in the assignedto
parameter w/ the obvious parameters listed above
'import is the importance of the TASK. 1=High, 2=Medium, 3=Low
'If you want a link to a NotesDocument then pass in a NotesDocument object for
the last parameter...linkto
'coded by Brian Arnold
%REM
Example of Usage:

subject = "TASK: " & doc.IssueTitle(0) & " requires completion by " &
doc.RCDueDate(0)
startdate = Today
duedate = Cdat(doc.RCDueDate(0))
assignedTo = doc.Champion(0)

body = "You've been assigned the Champion of Issue: " & doc.PRSNumber(0) &
Chr(10)

REM the empty sixth parameter below is no CopyTo and the "1" is high
importance!
-->> Call SendTask(assignedTo, subject, startdate, duedate, body, "", "1",
doc)

%END REM
Dim s As New notessession
Dim rtitem As notesrichtextitem

On Error Goto ErrorHandler
'***************do some checking of fields required to really send a
TASK...
If assignedto = "" Or duedate = "" Or subject = "" Then
Messagebox "Must have appropriate fields filled out to use SendTask()
! "
Goto TheEnd
End If
If startdate = "" Then startdate = Today
If import = "" Then import = "3"
'****************
Set maildoc = s.currentdatabase.createdocument
'setup fields passed into function for TASK
maildoc.Form = "Task"
maildoc.Subject = subject
maildoc.StartDateTime = startdate
maildoc.DueDateTime = duedate
maildoc.Importance = import
maildoc.SendTo = assignedto
maildoc.AssignedTo = assignedto
maildoc.AssignState = 2
maildoc.CopyTo = copyto

Set rtItem = mailDoc.CreateRichTextItem("Body")
Call rtItem.AddNewLine(2)
Call rtItem.AppendText(body)
If Not( linkto Is Nothing) Then
Call rtItem.AddNewLine(2)
Call rtItem.AppendText("Click link to open document -->")
Call rtItem.AppendDocLink(linkto, "Click link to open document")
End If

Call maildoc.Send(False, False) 'Send it on...

SendTask=True

Exit Function

ErrorHandler:
Print ( "Error " & Str$(Err) & ": " & Error$ )
Resume TheEnd

TheEnd:
SendTask = False

End Function

Dig Deeper on Domino Resources - Part 5

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close