Change map on GP invoices
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 (22.214.171.124) and CRM 4.0 with UR21 installed.
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!
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.
If you would like to submit an answer or comment, please sign in to the eOne portal.