Hi,
For some reason I was previously able to set the Due date when adding a action with the VB code below.
However this is not working now (ps - hard coded to test).
I do not get an error (response is 201) but the due date is always being set to yesterday! (nb: when <due></due> is used it defaults to today OK)
Also this is not a timezone thing (as you will be able to tell from the date I’ve used)
Any ideas??
Thanks in advance.
environment: TRACKS2 upgraded on a TurnkeyLinux 1.72 vm / posting from Windows7/Outlook2003.
Code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sData = “<todo>”
sData = sData & “<description>” + objTRACKS.Util_HTMLEncode(Mid(TodoFormx.Description.Value, 1, 99)) + “</description>”
sData = sData & “<notes>” & objTRACKS.Util_HTMLEncode(TodoFormx.Notes.Value) & “</notes>”
sData = sData & “<context_id>” & CStr(Contexts.Item(TodoFormx.ContextListBox.Value).Id) & “</context_id>”
If TodoFormx.NoDueDate = True Then
sData = sData & “<due></due>”
Else
sData = sData & “<due>29/06/2011</due>”
End If
If TodoFormx.ProjectListBox.Value <> “” Then sData = sData & “” & CStr(Projects(TodoFormx.ProjectListBox.Value).Id) & “</project_id>”
sData = sData & “<show_from>” & CStr(TodoFormx.CalShow.Value) & “</show_from>” ‘TodoFormx.CalShow.Value replaces Now()
sData = sData & “</todo>” & vbCrLf
Set objWinHttpRequest = objTRACKS.Util_SendWinHttpRequest(“POST”, “todos.xml”, False, sData)
If objWinHttpRequest.Status <> “201” Then MsgBox objWinHttpRequest.Status & ” - ” & objWinHttpRequest.StatusText
strLocation = objWinHttpRequest.GetResponseHeader(“Location”)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


