ToDo documents going into the Draft folder

Hi,

I have an application where if the user accepts a task, the code creates a To Do document for that task. The to do document gets created fine, but the to do documents also wind up in the draft folder and stay there even after a user marks the to do complete. I did not write the code to create the todo document so I don’t know if maybe something in the code(see below) is putting it in the draft folder. Can anybody point out to me how the todo is being placed in the draft folder? Thanks.

Set docToDo = userDb.CreateDocument

docToDo.Form = “Task”

docToDo.CalendarDateTime = assigneeRecDoc.ATRDueDate(0)

docToDo.SendTo = assigneeRecDoc.ATRAssignee(0)

docToDo.Subject = tmpTitle + " ** [GK] Req. Num: " + assigneeRecDoc.ATRReqNum(0)

popUpStr = docToDo.Subject(0)

docToDo.StartDate = assigneeRecDoc.ATRStartDate(0)

docToDo.DueDate = assigneeRecDoc.ATRDueDate(0)

docToDo.DueDateTime = assigneeRecDoc.ATRDueDate(0)

Select Case assigneeRecDoc.req_priorty(0)

Case “Immediate”, “High”

docToDo.Importance = “1”

Case “Medium”

docToDo.Importance = “2”

Case “Low”

docToDo.Importance = “3”

End Select

docToDo.TaskType = “1”

docToDo.Categories = “P”

docToDo.Alarms = “1”

docToDo.ReplaceItemValue “$Alarm”, 1

docToDo.ReplaceItemValue “$AlarmUnit”, “D”

docToDo.ReplaceItemValue “$AlarmMemoOoptions”, “”

docToDo.ReplaceItemValue “$AlarmDescription”, popUpStr

docToDo.ReplaceItemValue “$AlarmOffset”, 1

docToDo.Repeats = “1”

docToDo.StartDateTime = assigneeRecDoc.ATRDueDate(0)

docToDo.~_viewicon = 1 'document icon

docToDo.tmppownerHW = “1”

’ DueState identified status of ToDo. 0 = Overdue, 2 = Future, 8 = Rejected, 9 = Complete. All other value = Current

’ Initially, we set the status to Current (1)

Set todaysDate = New NotesDateTime(Date())

If todaysDate.dateonly < dueDate.dateonly Then

docToDo.DueState = 1

Else

docToDo.DueState = 0

End If

docToDo.~$SMTPKeepNotesItems = “1”

docToDo.~$PublicAccess = “1”

docToDo.~ExpandGroups = “3”

docToDo.AssignedTo = assigneeRecDoc.ATRAssignee(0)

docToDo.tmpNoActionBar = “1”

docToDo.Chair = session.CommonUserName

docToDo.OrgTable = “TO”

Set body = docToDo.CreateRichTextItem(“Body”)

Call body.AppendText(“The ‘Task’ Request " & tmpTitle & “, was Assigned on: " & Cstr(Today) & _”. Check the Task Request for details.”)

Call body.AppendText(Chr$(13) & "Please click on the following link to access the Task Request doc. —> ")

Call body.AppendDocLink(assigneeRecDoc,“”) Call docToDo.save(True, False)

docToDo.PutInFolder(“$Alarms”)