Greg On Dynamics Ax

Random thoughts about development using Dynamics AX and .Net

Automated Messaging to Office Communicator (from code)

leave a comment »

A new feature introduced with Dynamics AX 2009 was integration with Office Communicator.

This enables the presence of a person/contact to be shown as part of the contact information, along with links to contact that person:

Office Communicator integration with Dynamics AX

Office Communicator integration with Dynamics AX

Selecting the link to send an instant message to a contact launches the Office Communicator client conversation:
Office Communicator Client

The following job shows how to send an instant message to a contact using Office Communicator from code:

static void UCMAExample(Args _args)
{
    AlertSender.OCS_Sender ocSender;
    ;

    try
    {
        ocSender = new AlertSender.OCS_Sender(@"sip:Administrator@contoso.com", "ax-srv-03.contoso.com",
                                                        "Administrator", @"thepassword", "contoso");
        ocSender.SendMessage("sip:Alicia@contoso.com", "Hello from AX", "Normal");
    }
    catch(Exception::CLRError)
    {
        throw error(AifUtil::getClrErrorMessage());
    }
}

To enable this you will need to install the UCMA redistributable, available as part of the UCMA SDK download:
http://www.microsoft.com/downloads/details.aspx?FamilyID=b30306e4-7dc1-44d2-9a68-9b4a6fc5c2df&displaylang=en

You will also need to modify, compile and add the AlertSender.OCS_Sender .Net reference to AX, which is available to download here:
http://www.microsoft.com/downloads/details.aspx?FamilyId=9EFC784B-E443-4441-926C-5FD405D41BD9&displaylang=en

About these ads

Written by gregondax

January 18, 2010 at 9:02 am

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

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: