Skip to content
+1-888-319-3663

COMMUNITY FORUM

Change map on GP invoices

JosephMarkovich asked 10 years ago
I am trying to run the change map that was included with SmartConnect to load invoices from GP 2010 SP3 to CRM 4.0. Some of them are successful but then it produces this error on the screen:

Cannot insert duplicate key.

I ran the map to a file and looked at the XML — the GUID for the InvoiceDetailID field is the same as one in CRM for another invoice that imported successfully.

Why is it trying to use the same GUID?

I am running SmartConnect 2012 (20.12.0.16) and CRM 4.0 with UR21 installed.

Thank you.

-Joe
JosephMarkovich replied 10 years ago

Hi Kevin-

It's taken me a long time to get back to this problem — all is well.  I had a error in the map for the invoice products.  I was mapping the product ID to the invoice product ID by mistake.

Removed it and everything works just fine.

Thank you for the assistance!

-Joe

Answers
Best Answer
kevin answered 10 years ago
Hi Joe,

It is a little difficult to diagnose what is happening without looking at the map, but here goes.

I would check firstly where the GUID for the invoice lines are coming from. I assume that you are doing an update as well as a create, with a lookup to the invoice line for the lines that are to be updated. It is that lookup that is returning the duplicate value from CRM. Check that the lookup uniquely defines each line, and that it cannot return for more than one line.

e.g. If the lookup for the invoice line is on invoice number and item number, then it is possble for the same line to be returned more than once (in the instance of the same item on an invoice more than once)

Check the line that is failing and the line with the same GUID, see what is the same on the lines, and from that try to determine a better way of uniquely defining a line.

Please let me know how you go, also if I have missed what you are trying to do.

cheers

Kevin

If you would like to submit an answer or comment, please sign in to the eOne portal.