I’m trying to make a REST call to https://xxxxxx/E10Live/api/v1/Erp.BO.CustCntSvc/CustCnts
to update a contact. The rest call works in our testing environment no problem. But when I call it against the LIVE database it fails. Looking at the event log on the Epicor server we get this:
System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. —> System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint ‘PK_CustCnAttr’. Cannot insert duplicate key in object ‘Erp.CustCnAttr’. The duplicate key value is (SD, 1817, , 2, ).
The statement has been terminated.
Why is the BO trying to create another record in CustCnAttr instead of updating? This is weird because the same exact payload is working against the other slot with the same exact data! What is different about this table in live?