ToDo documents going into 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”)

Subject: RE: ToDo documents going into Draft folder

Two approaches:

[1] Open the drafts view in Domino Designer and look at the selection formula. Use the document properties dialog from a view to look at the values of the fields listed in the infobox. Evaluate the formula and see what fields having what values caused it to be in there.

[2] Create the same “To Do” manually. Export the document to a “structured text” file. Use a tool such as WinDiff to compare them and see which fields are missing/different. Note: TeamStudio Delta also has a “compare two documents” tool which would help with this.

Subject: RE: ToDo documents going into Draft folder

Thanks Andre. I found out from comparint 2 todo docs and found out I need to put the ExcludeFromView=D in the todo docs