Back

How to Address this SmartConnect to Dynamics GP Error: An item with the same key has already been added.

Published: Feb 04, 2026
Post Author Written by Pat Roth

I’m running a SmartConnect map to create a simple two-line Microsoft Dynamics GP journal entry. However, on the map execution, it fails with the error:

The confusion stems from the fact that we’re not integrating GP Items, so what is the actual issue and resolution?

An Item with the Same Key has Already been Added

This error message is caused by a bug in the Microsoft eConnect assembly.

When SmartConnect calls the Microsoft eConnect API, the Microsoft stored procedure for that method runs and can return one or more data validation errors.

If there is a failure, the eConnect assembly translates the error number(s) returned to give the text of the error as well as the XML of the data that produced the error.

However, the bug in the eConnect assembly is that if the same error is included multiple times – the assembly throw this .NET dictionary object error which hides the true eConnect error.

This error usually comes from AA as that is one of few nodes that give this error because all the AA records are processed at once vs one by one like the journal lines. But in this case, AA was not being used, and it is just the two lines and the journal header being processed.

Because we cannot get the true error number from the API due to this issue, we would have to resort to using a SQL Profile trace.

This is usually a good starting point for events to trace when debugging eConnect issues.

We could add the StmtComplete messages, but since the Microsoft procs are encrypted, it wouldn’t help tracing this issue.

To filter out the other SQL “noise” if this is a busy server, we can also add a Column Filter by pressing the button.

By using Task Manager, I can get the eConnect Service Windows Process ID or “PID”.

Then I can use the restriction for ClientProcessID = 1784 to filter out activity from any other process.

We could also restrict by user or database but this is simpler and will cut the trace down considerably.

Starting the trace and re-running the map again to get the error and stop the trace.

488 4 TraceResults

Looking at the SQL Profile Trace results, we see there isn’t much to it.

Just the one call to the taGLTransactionLineInsert procedure – eConnect didn’t make it to the second one and failed on the first line.

On the call, the variables @p41 and @p42 are the “output” parameters. The first one is the last error returned by the stored procedure where it stopped. The @p42 variable comes back from the @errString variable from the stored procedure. This is the space separated list of errors that occured.

This is the parameter that would have the “duplicates” and if we look closely there are two 483 values (and 7770 as well).

Now that we know the true error numbers, we can manually query the taErrorCode table in SSMS to find out the real problem.

488 5 taErrorCode

The Currency ID does not exist in MC40200.

Looking at the mapping for the ‘add line’ node and knowing which field to look at more closely, we find the cause of error was a typo on entering the Currency ID: Z-US instead of properly Z-US$.

After fixing the data error, the integration ran successfully.

If you have more questions on addressing the error “An item with the same key has already been added,” please contact us. Our team would be happy to assist.

Feeling stuck? Get the support and guidance you need to help you power through any data challenge

We're on your integration team. Connect with our people and let us know how we can help you.