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.

You cannot edit or modify the business logic in an eConnect stored procedure. To enable the customization of business logic, eConnect includes a pre and post stored procedures for each eConnect stored procedure. The pre stored procedure runs immediately before the eConnect stored procedure, while the post stored procedure runs immediately after the eConnect stored procedure. To customize the business logic, add SQL queries and commands to one or both of these stored procedures.

For example, assume you want the eConnect stored procedure named taCreateTerritory to always populate a field with a specified value. To implement your customization, add custom SQL code to the stored procedure named taCreateTerritoryPre that populates the field with the specified value. Your custom code runs immediately before every execution of the taCreateTerritory stored procedure.

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.