Tuesday, February 22, 2011

Upgrading an eConnect 10 Integration to eConnect 2010

I have had several clients upgrade to GP 2010, so I've had to upgrade several integrations to eConnect 2010.  I just upgraded 3 in the last week, so I thought I would document the general steps.  In this post, I'll cover the upgrade from eConnect 10 to 2010.  My focus is on the upgrade of .NET client applications that directly reference the eConnect assemblies.

If your eConnect .NET project is in Visual Studio 2005, I would recommend upgrading it to Visual Studio 2008.  I haven't had the need to install or use Visual Studio 2010 yet, but if you are adventurous, you could give it a try.

Before working on your .NET project, you will need GP 2010 and eConnect 2010 installed.  Note that eConnect 2010 is now available in a 64-bit flavor, so if you are installing on a 64-bit Windows machine, you have a choice of either version.  I haven't found any mention of the x86 vs. x64 versions in the documentation, so my assumption is that there isn't any specific benefit to either version.  On 64-bit machines, I'm currently opting to install the 64-bit version.

On to your Visual Studio project...

First, you will need to update your references to use the new eConnect 2010 assemblies.  Two of the eConnect 10 and 2010 assemblies have the same name (Microsoft.Dynamics.GP.eConnect and Microsoft.Dynamics.GP.Serialization), but the MiscRoutines assembly has been deprecated and its methods are now included in the main eConnect assembly.  Just delete your old GP 10 references, and add new references for the new eConnect DLLs located in the C:\Program Files\Microsoft Dynamics\eConnect 11.0\API directory.

Next, you will want to update your "using" directives to remove references to the MiscRoutines assembly if you are using it.  The GetNextDocNumbers and GetSopNumber classes in the new eConnect assembly replace the get doc numbers functionality of the MiscRoutines assembly.  Fortunately the GetNextDocNumbers methods are virtually identical to the GP 10 versions (the parameters don't have the same namespace), so using the new methods will only require minor changes to your code.

Finally, modify your eConnect import calls.  Instead of calling eConnect_EntryPoint, you will now call either CreateEntity (for master records) or CreateTransactionEntity (for transactions).  This does mean that you may need to have two different calls instead of the old single call, but everything else about the method call is essentially the same.

All of this is covered fully in the eConnect 10 Help file, so if you run into any issues during your upgrade, scan the help file to make sure you didn't miss anything.

My upgrades have gone very smoothly, only requiring changes to method names with no structural changes required.  Upgrading the Visual Studio project shouldn't take more than one or two hours for a basic integration.  However, make sure to reserve time for installing and configuring your GP 2010 development environment and fully testing your new integration.  I was able to get my integration code upgraded very quickly, but found that it could take over an hour to get my new GP 2010 environment configured exactly the same as my old GP 10 client environment so that I could properly test the integration.  Missing vendors, items, item sites, multi-bin, multi-currency, item currency decimals, GL accounts, you name it.  Once I had everything configured properly in GP, the eConnect 2010 integrations all worked flawlessly.

And before attempting to test, make sure that the eConnect 2010 service is installed and running.  This is the number one eConnect 2010 support issue I've had to deal with.  To help reduce those support calls, I've now added code to both check that the eConnect 2010 service is installed, and then check to see if the service is running.


        public bool DoesServiceExist()
        {
            ServiceController[] scServices;
            scServices = ServiceController.GetServices();
           
            try
            {
                foreach (ServiceController scService in scServices)
                {
                    if (scService.ServiceName == "DynGP11eConnect")
                    {
                        return true;
                    }
                }
                return false;
            }
            catch (Exception ex)
            {
                Log("An unexpected error occurred in eConn.DoesServiceExist: " + ex.Message);
                return false;
            }
        }
       
       
       
        public bool IsServiceStarted()
        {
            ServiceController sc = new ServiceController("DynGP11eConnect");

            try
            {
                if (sc.Status == ServiceControllerStatus.Running)
                    return true;
                else
                    return false;
            }
            catch (Exception ex)
            {
                Log("An unexpected error occurred in eConn.IsServiceStarted: " + ex.Message);
                return false;
            }
        }




Steve Endow is a Dynamics GP Certified Trainer and Dynamics GP Certified Professional.  He is also the owner of Precipio Services, which provides Dynamics GP integrations, customizations, and automation solutions.

http://www.precipioservices.com

No comments: