Welcome to Outlook2CRM Sign in | How to Register?
  The Official Outlook2CRM Development blog. Hosted by Ryan Farley, Director of Development for Customer FX Corporation and developer of Outlook2CRM.

  •  Marking E-mail as Complete from Outlook2CRM


    OK. This just keeps getting better. A while back, I posted some code to set the e-mail category from Outlook2CRM actions so you could visually see in Outlook what actions you've taken with an e-mail in SalesLogix. On that post, Martin Vierling posted a comment asking about doing the same with the "Complete" flag for e-mails when you use an Outlook2CRM action on them so the user can see which e-mails have been "completed" in SalesLogix.

    This is a great example of how flexible and easy to work with Outlook2CRM really is. With just a couple of lines of code I'll add this to any Outlook2CRM action script.

    ' Set Complete flag
    With Addin_NativeMailItem
        .FlagStatus = 1 'olFlagComplete
        .Save
    End With

    The result is pretty cool:

    Anything accessible in the Outlook object model is available via the Addin_NativeMailItem object in the Outlook2CRM API. One thing to remember, Outlook2CRM is compatible with Outlook v2000 and higher. So the MailItem exposed here is an Outlook 9.0.0.0 object so only those items exposed in Outlook9 are available.

    I'll be adding this to the list to include built in, and optional, support for this in the next version.

  •  Marking E-mail As Filed with Outlook2CRM


    A common question or request that has surfaced lately is how to flag e-mails as "filed" in some way when you've added them to SalesLogix using the Outlook2CRM functions. Well, good news. There will be limited support for this out of the box in the next version of Outlook2CRM. In the mean time, here's how you can do this now, in your current version of Outlook2CRM.

    What we'll be doing for this solution in this post is using the "categories" in Outlook to indicate that the e-mail has been filed. This way, we'll have a visual indicator that the e-mail has been filed in SalesLogix already. The great part is, that because Outlook2CRM is customizable and exposes the native Outlook MailItem to you via the API, this customization will be a breeze.

    In the scripts that fire as the event handlers for each Outlook2CRM button, you'll need to add the following code to the end of the existing code:

    Dim mail
    
    ' Grab the current MailItem from the Outlook2CRM API
    Set mail = Addin_NativeMailItem
    
    ' Categories are comma-delimmited. Check if the item already has categories
    If Trim(mail.Categories) <> "" Then mail.Categories = mail.Categories & ", "
    
    ' Add the new category and save the MailItem
    mail.Categories = "Filed: SalesLogix Ticket"
    mail.Save
    
    Set mail = Nothing

    That was pretty easy, right? The result will be as shown below.

    Not bad. A quick tweak that took only 2 minutes to make that will sure make your users happy.

  •  Changing the "Add Missing E-mail to Contact" Option on the Contact Match Dialog


    I've been asked a couple of times about how to change the default behavior of the "Add missing e-mail to contact" option on the Contact Match Dialog. This checkbox allows the contact record selected for matching an e-mail to be updated with the e-mail address from the selected e-mail. Using this option will add the missing e-mail address to the contact so that the next time the record will be automatically matched without the need for the user to select it manually.

    However, this can be a burden in some scenarios if you don't want the contact record updated and you forget to uncheck this option. A change slated for the next version of Outlook2CRM will make this checkbox remember a setting on a per-user basis. If a user unchecks this box it will remain unchecked for that user always, until the user checks it again. Theres no need to wait for the next version for this, the behavior of this checkbox can be easily changed now.

    How to Change the "Add Missing E-mail to Contact" Checkbox to Default to Unchecked:

    1. Open the form "Outlook2CRM Dialog - Select Contact Match" from the "Outlook2CRM" family in the Architect.
    2. Locate the checkbox, select it.
    3. In the property browser, change the Checked property from True to False
    4. Save & Release the form (It will prompt you to save as a new version, that is OK as long as you remember to release after)

    That is it. From that point on it will always come up unchecked by default.

  •  Using Outlook2CRM for Non-Standard Matching With Contacts


    I've been asked a time or two in the Outlook2CRM forums about the possibilities of having Outlook2CRM match an e-mail with a SalesLogix conact using something other than the standard method of using the e-mail sender's address to locate a matching contact. This is certainly possible with Outlook2CRM and is an easy task.

    Out of the box, the Outlook2CRM buttons all use the built-in methods of locating a matching contact from the sender's e-mail address and also make use of the Contact Match Dialog to prompt the user for how to match with the contact. The settings that tell the buttons to do this are all configurable in the Outlook2CRM Toolbar Editor. Please note, to change these properties you do need the Outlook2CRM Developer License.

    There are a few different button properties that tell Outlook2CRM to automatically match up with a contact using the sender's e-mail address. They are the following:

    • AutoContactMatch - This property tells Outlook2CRM to use the sender's e-mail address and automatically attempt to locate a matching contact in SalesLogix with the same e-mail address.
    • UseContactMatchScreen - This property tells Outlook2CRM to display the Contact Match Dialog to the user. This dialog shows the user the match (if any) that the e-mail automatically matched with and presents other options for creating the missing contact or manually selecting a match.
    • UseMatchScreenOnNoMatchOnly - This property goes hand-in-hand with the UseContactMatchScreen property and tells Outlook2CRM to only display the Contact Match Dialog if there was not an automatic matching contact found. If this property is set to True then if the AutoContactMatch yeilds a matching contact, the Contact Match Screen will not be displayed. It will only show if there was no matching contact.

    Make sense? So, as you can see from those properties, you can easily turn off the out of the box contact matching for Outlook2CRM if you'd like.

    Example

    Let's say that I wanted to have the "Ticket" button no longer match on the sender's e-mail address, but instead to parse an address from the message body and then proceed as normal. An easy enough task with Outlook2CRM. Let's take a look:

    The Outlook2CM Addin Client API script has methods for setting the "matched" contact or account to use, Addin_SetAccount & Addin_SetContact. We can create our own custom scheme for determining what the matched records are and then set the appropriate records using those API methods. Then the other screens, such as the Outlook2CRM Ticket screen (that allows the user to select to create a new ticket, or update an existing one) will use the values we've set in the API.

    Let's say our e-mail body looks like this:

    Source: Website
    Email: test@email.com
    Description: This is the description of the issue

    We want to match on the e-mail value located in the body, not the sender's address. To do this, we will open the Toolbar Editor and change the following properties for the Ticket button (or create a new button with these properties):

    AutoContactMatch = False
    UseContactMatchScreen = False

    Now, we'll open the script "Outlook2CRM Event - Create Ticket" (again, or create a new script instead) and add something along the lines of the following code:

    Sub Main
    Dim lines
    Dim email
    Dim i
    Dim rs
    Dim sql
    Dim retval
    
        lines = Split(Addin_Body, vbCrLf)
        For i = LBound(lines) To UBound(lines)
            If Left(LCase(lines(i)), 5) = "email" Then
                email = Trim(Mid(lines(i), 7))
    
                sql = "select firstname + ' ' + lastname as contactname, " & _
                        "contactid from contact where email like '" & email & "'"
    
                Set rs = Application.GetNewConnection.Execute(sql)
                If rs.RecordCount > 0 Then
                    'Lets set the matched contact
                    Addin_SetContact rs.Fields("contactid").Value, rs.Fields("contactname").Value & ""
                    retval = "success"
                Else
                    'No match, let's create a new contact/account
                    Addin_SetContactAction 2 'this tells the API we're going to create a contact *and* account
                    Application.BasicFunctions.DoInvoke "ActiveScript", "Outlook2CRM:Outlook2CRM Global - Create Contact Account"
                    retval = Application.BasicFunctions.InvokeResult
                End If
                rs.Close
                Set rs = Nothing
            End If
        Next
    
        'Now continue on to create the ticket
        If LCase(retval) = "success" Then Application.BasicFunctions.DoInvoke "Form", "Outlook2CRM:Outlook2CRM Dialog - Select Ticket Action"
    End Sub

    That would solve it and we'd still get to use the other Outlook2CRM screens. Make sense?

  •  Using Outlook2CRM to Match Outlook E-mail On Multiple E-mail Fields


    SalesLogix uses the CONTACT.EMAIL field for storing the contact's primary e-mail address. This is what Outlook2CRM uses to match an e-mail with a contact in SalesLogix. However, SalesLogix does have two other e-mail fields for a contact. These fields are not used by many, and it it likely that most users don't even know about these two other fields. The fields are CONTACT.SECONDARYEMAIL and CONTACT.EMAIL3.

    For those that do use these additional e-mail fields in SalesLogix, a quick customization can make Outlook2CRM utilize these fields when matching. This solution was provided by an Outlook2CRM beta tester, Antonio GarcĂ­a from LagaSoft in Berlin, Germany. The solution is outlined as follows:

    1. For the button in question, set the AutoContactMatch property to False (this will cause Outlook2CRM to avoid attempting to match)
    2. Customize the Contact Match Dialog as needed in Architect (Outlook2CRM:Outlook2CRM Dialog - Select contact match)
    3. Modify the VBScript plugin in Architect titled "Outlook2CRM:Outlook2CRM Event - Create Contact" to replace with the following code:
    'Including Script - Outlook2CRM:Outlook2CRM Addin Client API
    
    Sub Main
        Dim objBASIC
        Dim slxContactID
    
        Set objBASIC = Application.BasicFunctions
        
        slxContactID = Addin_Ex_ContactID
    
        If slxContactID <> "" Then
           objBASIC.ShowDetails "contact", slxContactID
        Else
           objBASIC.DoInvoke "Form", "Outlook2CRM:Outlook2CRM Dialog - Select contact match"
        End If
    
        If (Addin_AttachmentCount > 0) And (Addin_IncludeAttachedFiles) Then
            objBASIC.DoInvoke "Form", "Outlook2CRM:Outlook2CRM Dialog - Add Attachments"
        End If
    
        Set objBASIC = Nothing
    End Sub
    
    Function Addin_Ex_ContactID 
        Dim sSQL
        Dim objRS
    
        sSQL = "SELECT CONTACTID FROM CONTACT WHERE EMAIL = '"
        sSQL = sSQL & Addin_FromAddress & "' OR SECONDARYEMAIL = '"
        sSQL = sSQL & Addin_FromAddress & "' OR EMAIL3 = '" & Addin_FromAddress & "'"
    
        Set objRS = Application.GetNewConnection.Execute(sSQL)
    
        If Not objRS.EOF Then
            Addin_Ex_ContactID  = objRS.Fields("CONTACTID").Value & ""
        End If
    
        objRS.Close
        Set objRS    = Nothing
    End Function

    Thanks to an active beta tester for this great Outlook2CRM solution! Use at your own risk.

  •  Accessing the Native Outlook MailItem in Outlook2CRM Code


    There will likely be times when you need to access additional information about the selected e-mail in your Outlook2CRM scripts and forms than what is provided by the API include script. For this very reason, the API does expose the native Outlook MailItem for you to query for additional properties, or even manipulate if needed.

    The API exposes two objects for the Outlook MailItem.

    1. Addin_MailItem
    2. Addin_NativeMailItem

    There are some differences between the two.

    Addin_MailItem

    The Addin_MailItem object is a wrapped MailItem object. The custom wrapper is used for late-bound calls to the Outlook object model making Outlook2CRM version independent when it comes to the version of Outlook installed on the machine. It also avoids any security prompts with some direct MAPI calls. There will be more about this wrapped MailItem forthcoming in the documentation area.

    Addin_NativeMailItem

    This object is the native Outlook MailItem. Any documentation about the Outlook object model applies to this object. One thing to be aware of, this object will differ based on the version of Outlook installed on the pc since this object is dynamically created at runtime based on what it receives from Outlook. If the user is using Outlook 2000, then the MailItem object model for Outlook 2000 will apply.

    One of the current Outlook2CRM beta testers, Alexander Pfingstl, wanted to be able to determine if the selected e-mail in Outlook was in HTML format or not. Using the exposed Addin_NativeMailItem this is certainly possible. Let's put a sample together to demonstrate.

    'Including Script - Outlook2CRM:Outlook2CRM Addin Client API
    Option Explicit
    
    Sub AXFormOpen(Sender)
    Dim mail
    
        Set mail = Addin_NativeMailItem
    
        Select Case mail.BodyFormat
        Case 0
             MsgBox "Mail Format: Unspecified"
        Case 1
             MsgBox "Mail Format: Plain Text"
        Case 2
             MsgBox "Mail Format: HTML"
        Case 3
             MsgBox "Mail Format: Rich Text"
        End Select
    
        Set mail = Nothing
    End Sub

    You can see how easily we can query properties, such as the BodyFormat property to determine the format of the e-mail body, from the native Outlook MailItem object. Outlook2CRM will always give you the message body in plain text. If the body of the message is in HTML, you won't get all the HTML tags, just the text - as close to what the user would see when viewing the e-mail in Outlook. However, if you wanted to get the HTML from the e-mail, you could do the following:

    'Including Script - Outlook2CRM:Outlook2CRM Addin Client API
    Option Explicit
    
    Sub AXFormOpen(Sender)
    Dim mail
    Dim html
    
        Set mail = Addin_NativeMailItem
    
        If mail.BodyFormat = 2 Then ' 2=HTML
            html = mail.HTMLBody
            ' do something with the HTML...
        End If
    
        Set mail = Nothing
    End Sub

    Just make sure you always dereference the MailItem object by setting it to Nothing when you're done.

  •  Public Beta Coming Soon


    We will be having a public beta soon for Outlook2CRM. We've gone the rounds with the internal beta phase and things have been shaping up. I've enabled comments on this blog, please reply if you're interested in participating.
  •  New Core Function Added to Outlook2CRM - Leads!


    We're quickly approaching a public beta phase for Outlook2CRM and I wanted to make sure I added the last remaining core function of the base Outlook2CRM toolbar - support for leads for SalesLogix 7 systems! Now you can easily create a new lead from an e-mail and even include files attached to the e-mail as attachments on the lead record in SalesLogix!

     

    Of course, the SalesLogix feature for leads only exists in version 7 and higher, so systems with Outlook2CRM will get the following message if used on an earlier version (pre-version 7):

    Since Outlook2CRM is fully customizable, the leads button can easily be removed from the Outlook2CRM toolbar (until you upgrade to version 7, then just add it back!)

  •  Outlook2CRM - Creates, and now UPDATES!


    In the last post on the Outlook2CRM Development Blog, I mentioned the addition of the new Contact Match dialog. This new dialog was built to allow for key changes to be made to Outlook2CRM to more easily extend the capabilities of the out of the box buttons. The first of these new capabilities has now been implemented.

    The predecessor to Outook2CRM, the Outlook Ticket Addin, was able to create just tickets. The #1 feature request for that product was the ability to not only create new tickets, but to also update existing ones. Due to a design limitation of that product it was shelved, and now getting dusted off by Outlook2CRM. The new OOTB button for "Ticket" (notice the word "Create" has been dropped from the button's caption) will now take you to the new Ticket Action dialog:

    This new dialog gives you two options, the standard action to create a new ticket from the e-mail which works the same as before, and the new option to select an existing ticket to update from the e-mail. If the action to "update an existing ticket" is selected the contents of the e-mail is added to a new ticket activity - and of course, the files attached to the ticket (and any inline images) can also be included as attachments on the ticket (whether you're creating a new one or updating an existing one).

    And the best part, all this, of course, is customizable Yes

  •  The New Contact Match Dialog


    Those who have been involved in the internal beta for Outlook2CRM will see a new change in the Contact Match dialog in the new 0.9.1 beta build.

    For those who haven't seen Outlook2CRM yet, all (well most) e-mail need to match up to a contact in SalesLogix. The sender's e-mail address needs to either match up with an existing e-mail address, or you'll need to do one of the following actions: 1) Select an existing contact to match the sender to (in case you don't already have the e-mail address entered on the contact record), 2) create a new contact on an existing account for the sender, or 3) create a new contact and a new account for the sender. All of this is done from a single reusable dialog called the contact match dialog. This dialog can be used from custom buttons as well so you don't need tp worry about all that matching stuff.

    So, in the latest build that will be released this week to the internal beta includes a new and improved contact match dialog.

    The old dialog looked like this:

    Here is the new one:

    So what's the difference? Well, there's one major difference...

    While the old dialog was hard-coded in Outlook2CRM, the new one is built in Architect!

    What this means is that you can now customize the dialog if needed. We've had requests in the past to even do the slightest customizations, maybe change the lookup used to select a contact or account, tweak things here or there, or whatever. However, even bigger than that is that this change opens the door for some of he biggests feature requests for Outlook2CRM to date. Things like the ability to do more than just create. Having the ability to both create a ticket from an e-mail as well as update, or add to, an existing ticket (same changes can, and will be made now for other functions in Outlook2CRM as well for opportunities, contacts, etc).

    The old dialog, which was an idea brought over from the other Customer FX product, the Outlook Ticket Addin. The problem is that this idea (having the hard-coded dialog launched from the button in Outlook) is just plain inflexible. There are some downsides to having this critical dialog being open and available in Architect, but we're trusting Outlook2CRM developers and the added flexibility will be so much more worth it. And you will still have properties for Outlook2CRM addin buttons to be able to turn the contact match dialog on and off as needed, just as before. 

  •  Welcome to the Outlook2CRM Development Blog


    This blog will be the official development blog for Outlook2CRM. I will be posting updates about the development of Outlook2CRM, giving an insiders perspective as to how it works, the interactions with the SalesLogix client, and how to easily create new custom buttons for the Outlook2CRM toolbar. If you're an Outlook2CRM customer, evaluating the product, or a business partner, this is the place you'll find out all the cool stuff the docs don't tell you Wink.

    I've posted a few things about Outlook2CRM on my SalesLogix related blog but will be posting all Outlook2CRM related items here from now on. Stay tuned...

    Ryan Farley