How to Send Outlook Calendar Appointment in Ax 2012


Description:-

Job through you can send Outlook Calendar Appointment in Ax 2012

static void OutlookAppoinmentByUmesh(Args _args)
{
    COM        sysOutlookCollection;
    COM        collection;
    COM        receipiants;
    COMVariant comStartDate = new COMVariant();
    COMVariant comEndDate   = new
    COMVariant();
    COM        c;
    #SysOutLookCOMDEF
    #define.mapi("MAPI")
    #define.outlook("Outlook.Application")
    COM        sysOutlook;
    COM        sysOutlookNameSpace;
    COM        sysOutlookMAPIFolder;
    ;
    sysOutlook                  = new COM(#outlook);
    sysOutlookNameSpace         = sysOutlook.getNamespace(#mapi);
    sysOutlookNameSpace.logon();
    sysOutlookMAPIFolder        = sysOutlookNameSpace.getDefaultFolder(#OlDefaultFolders_olFolderCalendar);
    collection                  = sysOutlookMAPIFolder.items();
    c = collection.add();
    comStartDate.date(today());
    comStartDate.time(str2Time( "12:00:00"));
    comEndDate.date(today());
    comEndDate.time(str2Time( "12:45:00"));
    c.location('DOTCOM');
    c.subject('AX Meeting For Discuss');
    c.body('Lets discuss on whats new in AX 2012 Check This One');
    c.start(comStartDate);
    c.end(comEndDate);
    c.RequiredAttendees('YourID');
    //c.Recurrence();
    c.ReminderMinutesBeforeStart(20);
    //c.interface();
    c.save();
        if (c)
        {
            receipiants = c.Recipients();
            receipiants.add("OpponentID");
            receipiants.ResolveAll();
            //c= c.ForwardAsVcal();
            //c.assign();
            c.display();
            c.finalize();
            //c.SendToRecipients();
            //receipiants = c.receipiants();
            //receipiants.ResolveAll();
            //c.assign();
            info("The action is created in Microsoft Outlook");
        }
        else
            throw error("@SYS31969");
            sysOutlookNameSpace.logoff();
}

After run this Job you can check in your Outlook ID your Task is Send or not to recipients.

Related Posts

Previous
Next Post »

1 comments:

comments
December 27, 2021 at 6:53:00 PM GMT+5:30 delete

having issue with Message "Object 'COM' could not be created" string

Reply
avatar

Thanks for comments.....