Dynamics AX 2012: Job to create and sent outlook Tasks

Recently i got chance to work on AX integration project with OUTLOOK where i have to create the Tasks from dynamics ax in outlook and also email it to. check the job below that complete the requirements.

 static void OutlookAppointment(Args _args)  
   COM    sysOutlookCollection;  
   COM    receipiants;  
   COM    collection;  
   COMVariant comStartDate = new COMVariant();  
   COMVariant comEndDate  = new  
   COM    c;  
   COM    sysOutlook;  
   COM    sysOutlookNameSpace;  
   COM    sysOutlookMAPIFolder;  
   sysOutlook         = new COM(#outlook);  
   sysOutlookNameSpace     = sysOutlook.getNamespace(#mapi);  
   sysOutlookMAPIFolder    = sysOutlookNameSpace.getDefaultFolder(#OlDefaultFolders_olFolderTasks);  
   collection         = sysOutlookMAPIFolder.items();  
   c = collection.add();  
   comStartDate.time(str2Time( "12:00:00"));  
   comEndDate.time(str2Time( "12:45:00"));  
   c.subject("Meeting regd Microsoft Dynamics AX 2012");  
   c.body("Lets discuss on whats new in DAX 2012");  
   if (c)  
     receipiants = c.Recipients();  
     info("The action is created in Microsoft Outlook");  
   throw error("@SYS31969");  

5 Responses to Dynamics AX 2012: Job to create and sent outlook Tasks

  1. Mansoor says:

    Nice work brother.

  2. If you want to do something similar, but directly into Exchange (ie Office 365), then you can use the Exchange Webservices API (Microsoft.Exchange.Webservices). I have already implemented a solution for this in AX2012. Works like charm.

  3. I always used to study paragraph in news papers but now as I am
    a user of internet so from now I am using net for articles, thanks to web.

  4. Ayesha says:


    I want to do the same in batch class without outlook. Is it possible ? can you please send me sample code?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: