Epicor will not let me delete an invoice in a group. Below is the error I get when I try to delete it. Any assistance would be appreciated.
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_TaxSvcMessages’. Cannot insert duplicate key in object ‘Erp.TaxSvcMessages’. The duplicate key value is (HCI, I-1030167, 0).
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.Internal.Lib.ProcessTaxes.CancelTax(List`1 ttTxSvcHeadRows, Boolean& opCommFailure, String& opErrMessage) in C:_Releases\ERP\UD10.1.500.7\Source\Server\Internal\Lib\ProcessTaxes\ProcessTaxes\ProcessTaxes.i.cs:line 11101
at Erp.Internal.Lib.ProcessTaxes.CalcTaxes(Int32 ipQuoteNum, Int32 ipOrderNum, Int32 ipInvoiceNum, String ipAPInvKey, String ipCashHeadNum, Int32 ipPayHeadNum, Int32 ipShipPackNum, String ipEmpID, Int32 ipEmpExpenseNum, Int32 ipPoNum, Boolean whInclRgn, Boolean& opCommFailure, String& opMessage, Boolean& opTCStatus, List1& ttTxSvcHeadRows, List1& ttTxSvcDetailRows) in C:_Releases\ERP\UD10.1.500.7\Source\Server\Internal\Lib\ProcessTaxes\ProcessTaxes\ProcessTaxes.i.cs:line 7869
at Erp.Services.BO.ARInvoiceSvc.SetReadyToCalcEx(String ipGroupID, Int32 ipInvoiceNum, Boolean ipCalcAll, Boolean ipCalledFromUI, ARInvoiceTableset& ds) in C:_Releases\ERP\UD10.1.500.7\Source\Server\Services\BO\ARInvoice\ARInvoice.cs:line 38997
at Erp.Services.BO.ARInvoiceSvc.InvcDtlAfterUpdate() in C:_Releases\ERP\UD10.1.500.7\Source\Server\Services\BO\ARInvoice\ARInvoice.cs:line 0
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.UpdateRow(IceDataContext dataContext, Int32 tableNum, IIceTable table, IceRow updatedRow, IceRow originalRow, TablesetProfilingCollector parentTraceCollector) in C:_Releases\ICE\3.1.500.7\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 1186
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 895
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.ARInvoiceSvc.Update(ARInvoiceTableset& ds) in C:_Releases\ERP\UD10.1.500.7\Source\Server\Services\BO\ARInvoice\ARInvoice.Designer.cs:line 3909
at Erp.Services.BO.ARInvoiceSvc.UpdateMaster(ARInvoiceTableset& ds, String cGroupID, String cTableName, Boolean runCheckAmortSched, Boolean runChkLtrOfCredit, Boolean& genAmortSched, Boolean lRASchedExists, Int32 ipInvoiceNum, Int32 ipInvoiceLine, String cARLOCID, Boolean suppressUserPrompts, Decimal dTotalCharges, Boolean lGetDefaultAccount, Decimal& grpTotalInvAmt, String& opGenMessage, String& opLtrCrdMsg, Boolean& lUpdateRan) in C:_Releases\ERP\UD10.1.500.7\Source\Server\Services\BO\ARInvoice\ARInvoice.cs:line 40896
at Erp.Services.BO.ARInvoiceSvcFacade.UpdateMaster(ARInvoiceTableset& ds, String cGroupID, String cTableName, Boolean runCheckAmortSched, Boolean runChkLtrOfCredit, Boolean& genAmortSched, Boolean lRASchedExists, Int32 ipInvoiceNum, Int32 ipInvoiceLine, String cARLOCID, Boolean suppressUserPrompts, Decimal dTotalCharges, Boolean lGetDefaultAccount, Decimal& grpTotalInvAmt, String& opGenMessage, String& opLtrCrdMsg, Boolean& lUpdateRan) in C:_Releases\ERP\UD10.1.500.7\Source\Server\Services\BO\ARInvoice\ARInvoiceSvcFacade.cs:line 3007
at SyncInvokeUpdateMaster(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_TaxSvcMessages’. Cannot insert duplicate key in object ‘Erp.TaxSvcMessages’. The duplicate key value is (HCI, I-1030167, 0).
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, List1 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.ARInvoiceImpl.UpdateMaster(ARInvoiceDataSet ds, String cGroupID, String cTableName, Boolean runCheckAmortSched, Boolean runChkLtrOfCredit, Boolean& genAmortSched, Boolean lRASchedExists, Int32 ipInvoiceNum, Int32 ipInvoiceLine, String cARLOCID, Boolean suppressUserPrompts, Decimal dTotalCharges, Boolean lGetDefaultAccount, Decimal& grpTotalInvAmt, String& opGenMessage, String& opLtrCrdMsg, Boolean& lUpdateRan)
at Erp.Adapters.ARInvoiceAdapter.UpdateMaster(String cGroupID, String cTableName, Boolean runCheckAmortSched, Boolean runChkLtrOfCredit, Boolean& genAmortSched, Boolean lRASchedExists, Int32 ipInvoiceNum, Int32 ipInvoiceLine, String cARLOCID, Boolean suppressUserPrompts, Decimal dTotalCharges, Boolean lGetDefaultAccount, Decimal& grpTotalInvAmt, String& opGenMessage, String& opLtrCrdMsg, Boolean& lUpdateRan)
at Erp.Adapters.ARInvoiceAdapter.UpdateMasterUsingPasteInsert(String cGroupID, String cTableName, Boolean runCheckAmortSched, Boolean runChkLtrOfCredit, Boolean& genAmortSched, Boolean lRASchedExists, Int32 ipInvoiceNum, Int32 ipInvoiceLine, String cARLOCID, Boolean suppressUserPrompts, Decimal dTotalCharges, Boolean lGetDefaultAccount, Decimal& grpTotalInvAmt, String& opGenMessage, String& opLtrCrdMsg, Boolean& lUpdateRan, String pasteInsertColumnsToValidate)
at Erp.UI.App.ARInvoiceEntry.Transaction.Update(Boolean refreshGroup)
Inner Exception
===============
Violation of PRIMARY KEY constraint ‘PK_TaxSvcMessages’. Cannot insert duplicate key in object ‘Erp.TaxSvcMessages’. The duplicate key value is (HCI, I-1030167, 0).
The statement has been terminated.
