Procedure or function 'aagCreateGLWorkDist' expects parameter '@LedgerID', which was not supplied

David Meego - Click for blog homepageA number of support cases have popped up recently with this error message, it can occur when using eConnect to integrate General Ledger transactions or when using the eConnect Adaptor for General Ledger transactions from Integration Manager. Vaidy Mohan has some details in his post: GL With AA - IM2010 Integration - aagCreateGLWorkDist Error Message.

The LedgerID was added to Microsoft Dynamics GP 2010 for Analytical Accounting reports.  If you are using Reporting Ledgers (Tools>Setup>Financial>General) the Allow box will be marked for Reporting Ledgers. 

Microsoft Dynamics GP 2010 Service Pack 1 added a parameter called @LedgerID to the aagCreateGLWorkDist GP stored procedure.  This stored procedure is requiring the Ledger ID to be passed in with eConnect.

The problem is that when AA Development added the @LedgerID parameter to the aagCreateGLWorkDist in SP1, the core eConnect code was not made aware of this change and so there is not any code to pass in this parameter.

If you have ever installed AA and the AAG00102 table exists, eConnect code will hit the aagCreateGLWorkDist stored procedure and you will receive the error:

DOC 1 ERROR: System.Data.SqlClient.SqlError: Procedure or function 'aagCreateGLWorkDist' expects parameter '@LedgerID', which was not supplied.

It will not matter if you map or use a constant for the Ledger ID in the eConnect GL Transaction mapping, you will still receive the error.  There is no work-around for this error.

It is logged in our systems as Collaboration Request (CR) 8201 and Problem Report 60058: "Procedure or function 'aagCreateGLWorkDist' expects parameter '@LedgerID', which is not supplied".

A fix for this issue will be included in the November Compliance (and later) updates.

[Edit] The fix is released as part of the 2010 US Payroll Year End Update, see the following links to download:

Thanks to Dawn, Chris and Dave on the Developer support team for working on this issue.

David

02-Dec-2010: Add links for 2010 US Payroll Year End Update: MicrosoftDynamicsGP11-KB2435626-ENU.msp

CR 8201, PR 60058