Teamtask problem (Outlook library)

blue_wardrobe

Member
Licensed User
When I update a Teamtask value [via Basic4PPC], the value doesn't actually change.

I can edit the Teamtask flag, however, from Oxios ToDoList. The value can be read ok by Basic4PPC.

Interestingly, neither do Teamtask values sync through ActiveSync.

(WM6 Smartphone / Q9M)
 
Last edited:

blue_wardrobe

Member
Licensed User
Code to illustrate Teamtask problem

Before running, ensure there is no task with subject "AAAAAAAA" .

On both WM6 Standard and WM6.1 Professional, this code shows how you can initially set Teamtask, but not change it thereafter.

Am I doing something wrong, or is it Basic4PPC, or something else?

Hopefully,

BW
 

Erel

Administrator
Staff member
Licensed User
For some reason the TeamTask property doesn't get updated if it is the only property that was changed.
This happens in the underlying API and not in Basic4ppc code.
One workaround is to change the Body property and then return it to the original value:
B4X:
mytask.TeamTask = false
temp = mytask.Body
mytask.Body = ""
mytask.Update
mytask.Body = temp
mytask.Update
BTW, you can replace your loops with:
B4X:
i = tcol.FindItem("Subject","AAAAAAAA")
If i > -1 then
  mytask.value = tcol.GetItem(i)
End If
 

blue_wardrobe

Member
Licensed User
Thanks!

Thanks, Erel!

That explains the weirdness.

I am aware of the looping - I back engineered my test instrument from a much bigger piece of code that scans all tasks for certain conditions.

BW
 

blue_wardrobe

Member
Licensed User
Tweak to Erel's solution

:DErel's tweak works, except in the common situation that the task body is already empty, in which case the API doesn't see mytask.body as changing, and therefore doesn't update teamtask when update is called.

So you need to do:

mytask.teamtask = false
temp = mytask.body
if mytask.body="" then mytask.body="XYZZY" else mytask.body=""
mytask.update
mytask.body = temp
mytask.update​

There is nothing magic about "XYZZY". Or is there...? :D

BW
 
Top