eConnect Error Code Master

eConnect offers a lot of stored procedures which can be used for creating masters and transactions in Microsoft Dynamics GP. However, when these stored procedures are used, they return error codes which are numeric values, in case of any errors.

I landed into a scenario where I wanted to know how to debug these error codes into valid error messages. Since I was new to using eConnect stored procedures, I was wondering how eConnect returns valid error messages in case of errors. Since I believed eConnect DLL’s call these stored procedures internally.

After doing a bit of analysis, I noted that there is a table called “taErrorCode” in the DYNAMICS database, which contains the detailed description for all these errors. This table contains the error code returned by eConnect stored procedures and their relevant descriptions.

So friends, when you decide to use eConnect stored procedures in your query, you can get the actual error message from the aforementioned table instead of generating custom error messages in your code. :-)

This might be a simple solution for people who have used eConnect procedures before, but for people who have not used it and trying it out for the first time, this should save them some time and effort. :-)

Till next post…

VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: +1 (from 1 vote)

February 4, 2009 В· veeyeskay В· One Comment
Posted in: Customizations, Dynamics, Great Plains Total Views: 968

  • http://dynamicsgpland.blogspot.com/ Steve

    Thanks for the post, that's a good find. Depending on your needs for error handling, eConnect does return a full descriptive error message, along with the offending XML that caused the error. Just add the code below to your Catch block (before the typical Catch ex as Exception).

    The only downside to this approach is that the error message is too voluminous and technical for most users. Even though it may very clearly state the problem (i.e. Vendor does not exist), their eyes tend to glaze over and they just immediately ask for help.

    So I like your solution of querying the taErrorCode table to control and parse the error that is returned, while not having to write custom error messages.

    Catch eConnectError As eConnectException

    'If an econnect error occurs
    LogImport("eConnect error: " & eConnectError.GetBaseException.ToString & vbCrLf & vbCrLf & eConnectError.Message.ToString)
    isError = True
    responseMessage = eConnectError.GetBaseException.ToString

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)