Skip to main content

Extending the Default eConnect Business Logic with 'Pre' and 'Post' Stored Procedures

by Gloria Braunschweig
President, Dorian Enterprises, Computeration, Inc.
August 15 2013

This is fourth in a series of articles covering eConnect for Microsoft Dynamics® GP. Part 1 explained that the business logic for eConnect exists in stored procedures within the Dynamics GP company database.  Part 2 created an eConnect integration utilizing the .NET APIs within Visual Studio. Part 3 examined using eConnect directly from a SQL stored procedure

From the last posts we have shown examples of utilizing the business logic built into the eConnect stored procedures.  In this post we will examine ways to add-to or modify the existing business logic.  Direct modifications to existing stored procedures is never advised as any patch or update of Dynamics GP could overwrite these modifications.

To allow for modifications, each eConnect stored procedure has a corresponding "Pre" and "Post" stored procedure which executes before and after the main procedure accordingly.  The same parameters that are passed to the main stored procedure are also passed to the pre and post procedure as well.

For our example today we will examine utilizing this modification ability by using a real-life situation with an existing client who was already using the built in Dynamics GP Sales Order Processing (SOP) capability to override an account segment based on the inventory location.   In addition to using the inventory segment, the client wanted to override a different account segment based on the document ID of the SOP Order transaction.  Because these documents would integrate as Orders, they would not contain a GL distribution. Only SOP Invoices and Returns have general ledger account distributions, but because of workflow, the client needed each Order line to be assigned to specific ...

FREE Membership Required to View Full Content:

Joining MSDynamicsWorld.com gives you free, unlimited access to news, analysis, white papers, case studies, product brochures, and more. You can also receive periodic email newsletters with the latest relevant articles and content updates.
Learn more about us here

About Gloria Braunschweig

Gloria has experience across the full spectrum of business operations and management. Decades of experience are documented in the book Rapid Implementation, establishing Gloria as a specialists using Microsoft SQL tools for implementation, integration, and business intelligence related to Microsoft Dynamics GP.

Gloria writes and presents on lean implementation concepts and business management systems for small and mid-size businesses. 

Steve
Submitted by sendow24562 on Mon, 08/19/2013 - 20:19 Permalink

Thanks for the article. Two caveats about using the eConnect Pre and Post stored procedures. 1. The Pre and Post stored procedure parameters can vary between Dynamics GP minor versions. So if you develop and test the proc on GP 2010 SP 3, it may cause errors if deployed in a GP 2010 SP 1 environment due to a different number of parameters. The safest way to deploy is to script the Pre or Post procedure from the client's server first, and then copy your procedure code into that script. 2. Related to the above, the Pre and Post stored procedures are removed and recreated during GP upgrades. So make sure to have backups of the procedure scripts, and after an upgrade, review all of the parameters of the new procedure, comparing them to the old procedure, before re-deploying the procs. Invariably, this is forgotten, the custom pre and post scripts are removed, and clients wonder why certain eConnect data have problems after an upgrade. Thanks, Steve Endow Dynamics GP Certified Trainer Dynamics GP Certified IT Professional

In reply to by anonymous_stub (not verified)