views:

82

answers:

4

As an "EWS Managed API Newbie", I'm having some problems finding examples and documentation about creating and managing Tasks.

I've managed to create a task for myself without a problem. However, I really need to be able to do the following - if anyone could give me any pointers I'd really appreciate it...

  1. Create a Task and assign it to another user.
  2. Be able to interrogate the status of that task (percent complete, etc) whilst it is assigned to that user.
  3. Update the notes on the task at any time.

Thanks in advance for any pointers!

A: 

We also use EWS. So you've created a task? I think that setting the DisplayTo field will send the task to another user. If you've go the UniqueId (task.Id.UniqueId is a string) you can query/edit this item any time. Try

Task t = Task.Bind(service, new Id(uniqueId));
double percentComplete = t.PercentComplete;
t.Body = new MessageBody(BodyType.Text, "Some updated text");
t.Update(ConflictResolutionMode.AutoResolve);

Does this help?

Duracell
+1  A: 

Unfortunately, you cant set the Task.DisplayTo property. I would suggest that it's still the case that EWS doesn't support assigning tasks to others (see post) and that, in order to get the functionality you require, you'd have to create the item in the Tasks folder of the user that you want to assign it to (this is different to assigning, which you would do from your own folder)

While i have this functionality working with the proxy classes, i dont yet have it working with the managed API. I would assume that you can use the FindFolder method to retrieve the assignee's tasks folder, and then create the item there, but i'll have a look, and update when i have a working version.

Watch this space ;-)

LoneDeveloper
Thanks for looking into this for me - it's very much appreciated! I eagerly await your response...
Chris Roberts
+1  A: 

I've been taking a look into this, and i'm not sure it's possible using the Managed API.

I've got a system set up using four sample user folders, and a central admin user with delegated access to each of those user's mailboxes. When i attempt to find folders using the API, i can only find the folders of the user who's credentials i supply when creating the service object.

I'm also using the auto-generated proxy objects (only picked up the API to try and help), and I use the following process to create a task for another user (this works correctly...):

  1. Connect to the server as the central admin account.
  2. Create the task object as you would for your own account.
  3. Create a reference to the Tasks folder of the user that you want to send the item to.
  4. Create a CreateItemRequest object to pass to the server, and add the two items from steps 2 and 3 to the request

When the request is sent, the item is created in the target user's folder.

I was hoping that this sequence might be possible in the managed API, but it doesnt seem to work.

I'll keep working on it as i get the chance, but i have other issues with appointments that i'm working on as well. I figured the sequence might help anyone else looking, in case they have more luck.

Sorry i cant provide any more info at the moment

LoneDeveloper
Really appreciate your help with this - I'll add a web reference and have a play with it myself, too. Will let you know if I get anywehere?!!
Chris Roberts
A: 

Another option is set use the ExchangeService ImpersonatedUserId property to impersonate the user who will be assigned the Task. Impersonate the user before creating the task and it should be created in their Tasks folder.

dan9298