Enterprise Solutions


What is eConnect?

Microsoft eConnect is a set of solutions that allows companies to integrate their business applications with Dynamics GP. It is a part of a .NET assembly to streamline all of your data and applications and keep all of your departments on the same page.

What eConnect can do

eConnect has the ability to integrate many of the business applications and systems you use within your company. This includes storefronts, POS (point-of-sale) systems, web services, and legacy applications. Once integrated, these systems can perform functions that control Dynamics GP and the data it contains such as managing internal documents and records.

eConnect allows you to enhance your applications as follows:
  • Add real-time access to Dynamics GP data. eConnect provides real-time access to back office data. It offers a way to add up-to-date back office information to existing front office applications like web storefronts or service applications.
  • Share financial management data across applications. eConnect allows multiple applications to share financial management data. The eConnect interfaces can support a number of independent applications. Changes to financial data in Dynamics GP are simultaneously available to all applications with an eConnect connection to that company in Dynamics GP.


Application integrations using eConnect include the following benefits:


  • Reduce development time. eConnect has a large number of integration points for Microsoft Dynamics GP. Software developers can quickly add back office integration to an application. This reduces cost by simplifying the development effort while providing fast access to Microsoft Dynamics GP data. eConnect also reduces development time when the business logic contained in the back office is reused by new custom applications.An eConnect integration also reduces costs by reducing data re-entry. An automated eConnect integration between Microsoft Dynamics GP and a new or existing online storefront, web service, or other data source eliminates the time and cost of manually copying data.
  • Reuse existing development tools. eConnect allows software developers to select their tool of choice when working with eConnect. Developers can use Microsoft .NET, Microsoft SQL Server stored procedures, BizTalk, or MSMQ.
  • Leverage industry-standard technologies. eConnect includes components for MSMQ and BizTalk Server, which are industry standard tools that support integration between applications.eConnect also uses XML documents to move data into and out of Microsoft Dynamics GP. The XML documents are a text-based representation of back office data. An XML schema specifies the data that is included in each type of XML document. This allows eConnect to provide back office integration to any application capable of creating or consuming these XML documents.


Architecture diagram

eConnect installs a collection of components that work together to provide programmatic access to Microsoft Dynamics GP data, following diagram illustrates the basic components:

The diagram illustrates eConnect’s two key layers and the components that make up those layers. The two layers are as follows:

  • The data access layer contains the eConnect business objects. The business objects are a collection of SQL stored procedures installed on the Microsoft

Dynamics GP server. eConnect uses the business objects to perform all retrieve, create, update, and delete operations.

  • The runtime layer contains a collection of files, Windows services, and components that provide the application programming interfaces (API) you use to send or retrieve XML documents. The API enable your application to use the business objects. You must install the components of the runtime layer on the same computer as your integrating application. When you develop a new application, install and use the API that best meets your integration needs.

Transaction Requester

The Transaction Requester is a collection of SQL database tables and database triggers that eConnect uses to make Dynamics GP data changes available to the Outgoing Service. The following diagram illustrates the Transaction Requester:

When you install the Transaction Requester, the installer creates three tables in each specified Microsoft Dynamics GP database:

  • eConnect_Out   This table stores data from selected create, update, or delete operations that occur within Microsoft Dynamics GP. The data identifies the individual transactions that occurred. The Outgoing Service uses the data in this table to create an XML document that is placed in a queue.
  • eConnect_Out_Setup   This table contains configuration information for the Transaction Requester. To keep the Transaction Requester working, do not make changes to this table.
  • eConnectOutTemp   This table is a temporary data store.


Business objects

The stored procedures contain the business logic used by eConnect. Any integration that uses eConnect to query, create, update, or delete data from Microsoft Dynamics GP uses one or more of these stored procedures.

The eConnect business objects include the Microsoft Dynamics GP documents and transactions that are commonly used in application integration. While eConnect supplies a large number of documents, not every Microsoft Dynamics GP feature is available through eConnect.


The following diagram shows the typical sequence of events that occur within a business object:

Notice how the business object validates data parameters, adds default values, and performs a status check after each event. The business object uses status checks to handle errors. When a status check detects an error, it immediately stops the stored procedure, initiates a rollback of the transaction, and returns an error message to the caller.

For example, a status check detects that an error occurred during the update operation of the business object. The status check immediately stops the stored procedure, rolls back the transaction, and then returns an error message. In this scenario, the business object never runs the post stored procedure.

The eConnect business objects are placed on your database server during the install of Microsoft Dynamics GP, and the creation of a new company database. There are two ways to access the business objects.

  • Call individual business objects from the integrating application. However, direct calls require you to implement a connection to the database server, add security restrictions that prevent unauthorized access to data, and include proper error handling. For more information about direct calls, see Calling the business objects.
  • Use one of the APIs that eConnect provides. The APIs offer a simpler approach to using the eConnect business objects from an integrating application. The types of eConnect APIs that are available are discussed in the sections that follow.



eConnect APIs

eConnect provides a collection of APIs that allow you to use the business objects. There are APIs for Microsoft .NET, and Microsoft Message Queuing (MSMQ). The variety of eConnect APIs allows you to use the interface that best fits your integration project and the available development tools.


eConnect and .NET

The classes in the Microsoft.Dynamics.GP.eConnect assembly allows us to build integration applications using .NET. these classes to enable your .NET application to create, update, retrieve, and delete or void Microsoft Dynamics GP data. To use eConnect in .Net development, the following are involved


  • Dynamics.GP.eConnect
  • Using CreateEntity for new records
  • Retrieving XML documents with GetEntity
  • Retrieving a document number
  • Returning a document number
  • Retrieving a sales document number
  • Returning a sales document number
  • eConnect exception handling

Example to create an eConnect application using C#

 Create a Customer

The application demonstrates how to use the eConnect .NET assemblies to create a new Microsoft Dynamics GP customer. This console application provides a basic example of creating Microsoft Dynamics GP data with eConnect.

Summary: This Sample creates a customer.xml document and passes it to the Microsoft.Dynamics.GP.eConnect assembly

using System;
using System.IO;
using System.Xml;
using System.Text;
using System.Xml.Serialization;
using Microsoft.Dynamics.GP.eConnect;
using Microsoft.Dynamics.GP.eConnect.Serialization;

namespace eConnect_CSharp_ConsoleApplication
	class Test
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		static void Main()
			string sCustomerDocument;
			string sXsdSchema;
			string sConnectionString;

            using (eConnectMethods e = new eConnectMethods())
                    // Create the customer data file

                    // Use an XML document to create a string representation of the customer
                    XmlDocument xmldoc = new XmlDocument();
                    sCustomerDocument = xmldoc.OuterXml;

                    // Specify the Microsoft Dynamics GP server and database in the connection string
                    sConnectionString = @"data source=localhost;initial catalog=TWO;integrated security=SSPI;persist security info=False;packet size=4096";

                    // Create an XML Document object for the schema
                    XmlDocument XsdDoc = new XmlDocument();

                    // Create a string representing the eConnect schema
                    sXsdSchema = XsdDoc.OuterXml;

                    // Pass in xsdSchema to validate against.
                    e.CreateEntity(sConnectionString, sCustomerDocument);
                // The eConnectException class will catch eConnect business logic errors.
                // display the error message on the console
                catch (eConnectException exc)
                // Catch any system error that might occurr.
                // display the error message on the console
                catch (System.Exception ex)
                    // Call the Dispose method to release the resources
                    // of the eConnectMethds object
            } // end of using statement

		public static void SerializeCustomerObject( string filename )
				// Instantiate an eConnectType schema object
                eConnectType eConnect = new eConnectType();
				// Instantiate a RMCustomerMasterType schema object
                RMCustomerMasterType customertype = new RMCustomerMasterType();
                // Instantiate a taUpdateCreateCustomerRcd XML node object
                taUpdateCreateCustomerRcd customer = new taUpdateCreateCustomerRcd();
                // Create an XML serializer object
                XmlSerializer serializer = new XmlSerializer(eConnect.GetType());

				// Populate elements of the taUpdateCreateCustomerRcd XML node object
                customer.CUSTNMBR = "Customer001";
				customer.CUSTNAME = "Customer 1";
				customer.ADDRESS1 = "2002 60th St SW";
				customer.ADRSCODE = "Primary";
				customer.CITY = "NewCity";
				customer.ZIPCODE = "52302";
				// Populate the RMCustomerMasterType schema with the taUpdateCreateCustomerRcd XML node
                customertype.taUpdateCreateCustomerRcd = customer;
				RMCustomerMasterType [] mySMCustomerMaster = {customertype};
                // Populate the eConnectType object with the RMCustomerMasterType schema object
                eConnect.RMCustomerMasterType = mySMCustomerMaster;

				// Create objects to create file and write the customer XML to the file
                FileStream fs = new FileStream(filename, FileMode.Create);
				XmlTextWriter writer = new XmlTextWriter(fs, new UTF8Encoding());

				// Serialize the eConnectType object to a file using the XmlTextWriter.
				serializer.Serialize(writer, eConnect);
            // catch any errors that occur and display them to the console
			catch (System.Exception ex)



eConnect Overview: https://msdn.microsoft.com/en-in/library/aa973831.aspx

eConnect Architecture: https://msdn.microsoft.com/en-us/library/aa973835.aspx

eConnect XML Schema Reference: https://msdn.microsoft.com/en-us/library/ff623651.aspx

About The Author

Leave a Reply