Hi All! Last week I put in a request for help on using Outlook Tasks automation. I was helped by a couple of people promptly (via e-mail). Thanks! I have also learned how to parse the existing tasks and find an existing task and update it. If you are interested, attached is a codeunit that both creates and updates a task. I have created a module in Navision that allows users to request an enhancement. Once the task is scheduled, a new Task in Outlook is created. Once I complete the request, Outlook is updated. download Bill Benefiel Manager of Information Systems Overhead Door Company billb@ohdindy.com (317) 842-7444 ext 117
Bill, Thanks for sharing the answers with us. But! May I ask the members who gave the answers to Bill to please post their answers to the forum next time and not only to the individual who asked the question. While this wouldn’t have made any difference to Bill it would have helped many people who have the same or similar problems. ------- With best regards from Switzerland Marcus Fabian
Bill Would you be able to post this as a text download or as a complete set of simplified objects? I cannot design/export the object as Tabledata 50051 does not exist. Similarly, with the new Outlook task creator in the downloads section I get an error saying: “Invalid assignment. It is not possible to assign a _TaskItem to a TaskItem” Anyone got an answer to this one? Thanks Craig Bradney Technical Manager Navision Solutions & Services, Deloitte Touche Tohmatsu Email:cbradney@deloitte.com.au
The source code provided in the test file shoud use the _Taskitem class… at least thats what works here anyway. Craig Bradney Technical Manager Navision Solutions & Services, Deloitte Touche Tohmatsu Email:cbradney@deloitte.com.au
Is anyone able to create a TaskRequestItem? TaskItems are nice but somewhat useless for automatic creation over a network. Craig Bradney Technical Manager Navision Solutions & Services, Deloitte Touche Tohmatsu Email:cbradney@deloitte.com.au
Due to my time constraints, I don’t really have time to find all of the objects in questions and export them as text. As an alternative, I will paste the relevent code below. Hope this helps: CREATETASK() Variables: Name DataType Subtype Length olApp Automation ‘Microsoft Outlook 9.0 Object Library’.Application olTask Automation ‘Microsoft Outlook 9.0 Object Library’.TaskItem User Record User {----Code—} WITH EnhancementReqHeader DO BEGIN User.GET(USERID); IF User.“Enhancement Req. Type” <> User.“Enhancement Req. Type”::Developer THEN EXIT; CREATE(olApp); olTask := olApp.CreateItem(3); olTask.Categories := “No.”; olTask.Subject := “Brief Description”; IF “Due Date” <> 0D THEN olTask.DueDate := “Due Date”; olTask.PercentComplete := “Percent Complete”; IF Status = Status::Complete THEN olTask.Complete := TRUE ELSE olTask.Complete := FALSE; IF “Completion Date” <> 0D THEN olTask.DateCompleted := “Completion Date”; olTask.Save; “Inserted Into Outlook?” := TRUE; IF MODIFY THEN ; //remove possibility of run-time error. CLEAR(olTask); CLEAR(olApp); END; UPDATETASK() Variables: Name DataType Subtype Length olApp Automation ‘Microsoft Outlook 9.0 Object Library’.Application olTask Automation ‘Microsoft Outlook 9.0 Object Library’.TaskItem olNS Automation ‘Microsoft Outlook 9.0 Object Library’.NameSpace olFolder Automation ‘Microsoft Outlook 9.0 Object Library’.MAPIFolder str Text 100 del Char User Record User {----Code—} WITH EnhancementReqHeader DO BEGIN User.GET(USERID); IF User.“Enhancement Req. Type” <> User.“Enhancement Req. Type”::Developer THEN EXIT; IF “Inserted Into Outlook?” THEN BEGIN CREATE(olApp); olNS := olApp.GetNamespace(‘MAPI’); olFolder := olNS.GetDefaultFolder(13); del := 39; // ’ str := '[Categories] = ’ + FORMAT(del) + “No.” + FORMAT(del); olTask := olFolder.Items.Find(str); olTask.Categories := “No.”; //Using Categories as a field to hold the Enhancement Req. No. olTask.Subject := “Brief Description”; IF “Due Date” <> 0D THEN olTask.DueDate := “Due Date”; olTask.PercentComplete := “Percent Complete”; IF Status = Status::Complete THEN olTask.Complete := TRUE ELSE olTask.Complete := FALSE; IF “Completion Date” <> 0D THEN olTask.DateCompleted := “Completion Date”; olTask.Save; CLEAR(olTask); CLEAR(olApp); CLEAR(olFolder); CLEAR(olNS); END ELSE CreateTask(EnhancementReqHeader); END; Bill Benefiel Manager of Information Systems Overhead Door Company billb@ohdindy.com (317) 842-7444 ext 117
Bill, As you seem to have worked out a couple of things with Outlook, may I ask if you have done something on synchronizing the Outlook addressbook with Navision also? If so, would you be so kind to post sample code? John
I would also like to know about synchronising Outlook contacts with Contacts (probably with a new flag like “Sync with Outlook” set). I have tried to get Navision to create Outlook contacts but it doesnt seem to want to instantiate the ContactItem globals/records properly. With regards to creating Tasks, to create anything in Outlook Navision using the automation controllers needs to have Outlook open. Is there a way to detect if Outlook is open or not. Creating anything, including taskitems depends on this and hence itd be nice to trap the automation error if Outlook is not open. Any ideas? Craig Bradney Technical Manager Navision Solutions & Services, Deloitte Touche Tohmatsu Email:cbradney@deloitte.com.au
I have not done the sync with Contacts in Outlook. The way I have reached sucess (other than help from this forum) is to go to www.microsoft.com and search the knowlege base for Outlook automation. This will usually return a list including “How to …”. Since I know Access & VB, I can usually translate the code If you find a vb example and “don’t speak vb”, feel free to e-mail it to me & I’ll be happy to try to translate it for you. Bill Benefiel Manager of Information Systems Overhead Door Company billb@ohdindy.com (317) 842-7444 ext 117 Edited by - wbenefiel on 2001 Jun 27 21:56:18