We tried to add a contact to a customer and got the following error. Anyone knows why and can help? Thanks.
Application Error
Exception caught in: Epicor.ServiceModel
Error Detail
============
Message: An error occurred while updating the entries. See the inner exception for details.
Inner Exception Message: Violation of PRIMARY KEY constraint ‘PK_CustCnAttr’. Cannot insert duplicate key in object ‘Erp.CustCnAttr’. The duplicate key value is (HCI, 14675, 7, 1, ).
The statement has been terminated.
Program: Epicor.ServiceModel.dll
Method: ShouldRethrowNonRetryableException
Client Stack Trace
==================
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
at Ice.IceDataContext.SaveChanges(SaveOptions options) in C:_Releases\ICE\3.1.500.7\Source\Framework\Epicor.System\Data\IceDataContext.cs:line 328
at Ice.IceDataContext.Validate[TLinqRow](TLinqRow row) in C:_Releases\ICE\3.1.500.7\Source\Framework\Epicor.System\Data\IceDataContext.cs:line 295
at Erp.Services.BO.CustCntSvc.updateAttributes() in c:_Releases\ERP\RL10.1.500\Source\Server\Services\BO\CustCnt\CustCnt.cs:line 1670
at Erp.Services.BO.CustCntSvc.CustCntBeforeUpdate() in c:_Releases\ERP\RL10.1.500\Source\Server\Services\BO\CustCnt\CustCnt.cs:line 888
at Ice.Services.Trace.TablesetProfilingCollector.DoRowEventTrace(String tableName, String methodName, Int32 rowCount, Action action) in C:_Releases\ICE\3.1.500.7\Source\Framework\Epicor.Ice\Services\TablesetProfilingCollector.cs:line 146
at Ice.TablesetBound`3.CreateRow(IceDataContext dataContext, Int32 tableNum, IIceTable table, IceRow newTablesetRow, TablesetProfilingCollector parentTraceCollector) in C:_Releases\ICE\3.1.500.7\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 1026
at Ice.TablesetBound`3.WriteTable(IceDataContext dataContext, Int32 tableIndex, IIceTable table, TablesetProfilingCollector parentTraceCollector) in C:_Releases\ICE\3.1.500.7\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 886
at Ice.TablesetBound`3.InnerUpdate(IceDataContext dataContext, TFullTableset tableset) in C:_Releases\ICE\3.1.500.7\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 797
at Erp.Services.BO.CustCntSvc.Update(CustCntTableset& ds) in c:_Releases\ERP\RL10.1.500\Source\Server\Services\BO\CustCnt\CustCnt.Designer.cs:line 846
at Erp.Services.BO.CustCntSvcFacade.Update(CustCntTableset& ds) in c:_Releases\ERP\RL10.1.500\Source\Server\Services\BO\CustCnt\CustCntSvcFacade.cs:line 344
at SyncInvokeUpdate(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func`2 func) in C:_Releases\ICE\3.1.500.7\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func`2 func) in C:_Releases\ICE\3.1.500.7\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 47
at Epicor.Hosting.Wcf.EpiOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in C:_Releases\ICE\3.1.500.7\Source\Framework\Epicor.System\Hosting\Wcf\EpiOperationInvoker.cs:line 23
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
Inner Trace:
Violation of PRIMARY KEY constraint ‘PK_CustCnAttr’. Cannot insert duplicate key in object ‘Erp.CustCnAttr’. The duplicate key value is (HCI, 14675, 7, 1, ).
The statement has been terminated.
: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary2 identifierValues, List
1 generatedValues)
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
at Erp.Proxy.BO.CustCntImpl.Update(CustCntDataSet ds)
at Erp.Adapters.CustCntAdapter.OnUpdate()
at Ice.Lib.Framework.EpiBaseAdapter.Update()
at Erp.UI.App.CustomerEntry.Transaction.UpdateContacts()
Inner Exception
===============
Violation of PRIMARY KEY constraint ‘PK_CustCnAttr’. Cannot insert duplicate key in object ‘Erp.CustCnAttr’. The duplicate key value is (HCI, 14675, 7, 1, ).
The statement has been terminated.