Exception when viewing Invoices for single supplier

We have had an issue for a while now that we have just ‘dealt with’, as there is another way to view the data, however it is at the point now where I just want to find the underlying cause.

When I go to Supplier Tracker > Links > Invoices then either Closed or All, and click “Retrieve”, an Application Error. The full details of the error are shown below.

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: Parameter value ‘-158329674399744.000’ is out of range.
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.600.15\Source\Framework\Epicor.System\Data\IceDataContext.cs:line 352
at Ice.IceDataContext.Validate[TLinqRow](TLinqRow row) in C:_Releases\ICE\3.1.600.15\Source\Framework\Epicor.System\Data\IceDataContext.cs:line 311
at Erp.Services.BO.APInvoiceSvc.adjustRoundingVar(Int32 inVendorNum, String inInvoiceNum, Int32 inInvoiceLine, String inLineType, Decimal inVariance, Decimal inDocVariance, Decimal inRpt1Variance, Decimal inRpt2Variance, Decimal inRpt3Variance, Boolean& forceRefreshed) in C:_Releases\ERP\UD10.1.600.15\Source\Server\Services\BO\APInvoice\APInvoice.cs:line 24787
at Erp.Services.BO.APInvoiceSvc.getMiscChargeVar(Decimal& miscChargeVar, Decimal& docMiscChargeVar, Decimal& rpt1MiscChargeVar, Decimal& rpt2MiscChargeVar, Decimal& rpt3MiscChargeVar, Boolean& forceRefreshed, Boolean Tracker) in C:_Releases\ERP\UD10.1.600.15\Source\Server\Services\BO\APInvoice\APInvoice.cs:line 26350
at Erp.Services.BO.APInvoiceSvc.APInvHedAfterGetRowsTracker() in C:_Releases\ERP\UD10.1.600.15\Source\Server\Services\BO\APInvoice\APInvoice.cs:line 5021
at Erp.Services.BO.APInvoiceSvc.GetRowsForTracker(Int32 vendnum, Boolean all, Boolean open) in C:_Releases\ERP\UD10.1.600.15\Source\Server\Services\BO\APInvoice\APInvoice.cs:line 4942
at Erp.Services.BO.APInvoiceSvcFacade.GetRowsForTracker(Int32 vendnum, Boolean all, Boolean open) in C:_Releases\ERP\UD10.1.600.15\Source\Server\Services\BO\APInvoice\APInvoiceSvcFacade.cs:line 118
at SyncInvokeGetRowsForTracker(Object , Object , Object )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object inputs, Object& outputs)
at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func2 func) in C:\_Releases\ICE\3.1.600.15\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59 at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func2 func) in C:_Releases\ICE\3.1.600.15\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.600.15\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:
Parameter value ‘-158329674399744.000’ is out of range.
: at System.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, _SqlRPC rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource1 completion, Int32 startRpc, Int32 startParam) 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, TaskCompletionSource1 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.APInvoiceImpl.GetRowsForTracker(Int32 vendnum, Boolean all, Boolean open)
at Erp.Adapters.APInvoiceAdapter.GetRowsForTracker(Int32 vendor, Boolean all, Boolean open)

Inner Exception

Parameter value ‘-158329674399744.000’ is out of range.

I queried the APInvDtl table for all records with the VendorID of 202 and copied it into a text file (to prevent Excel from manipulating anything if I were to paste it into there) and searched for just a portion of that value (674399) to see if it appeared anywhere, and it did not.

I can only assume that their is a piece of malformed data somewhere in that table relating to that VendorID but with over 1 million individual data points, it will be next to impossible to locate.

Can anyone offer some advice/assistance on the best way to figure this out?

Have you checked what the error message on the server is? Or traced the client or server?

We have the same issue with some suppliers. It started in E9 then went onto in E10.1 and still is the same in 10.2. So, the upgrades did not help either. Have been ignoring it, will have to make a support call, I guess at some point.

Vinay Kamboj

I did, and either I don’t know how to utilize it or it isn’t giving me what I am looking for…The only thing that shows up in there that has anything to do with this is this:

<tracePacket>
  <businessObject>Erp.Proxy.BO.APInvoiceImpl</businessObject>
  <methodName>GetRowsForTracker</methodName>
  <appServerUri>net.tcp://mercury/E10Production/</appServerUri>
  <returnType>Erp.Tablesets.APInvoiceTableset</returnType>
  <localTime>2/26/2021 11:03:00:3741052 AM</localTime>
  <threadID>1</threadID>
  <executionTime total="2351" roundTrip="2343" channel="0" bpm="0" other="8" />
  <retries>0</retries>
  <parameters>
    <parameter name="vendnum" type="System.Int32"><![CDATA[202]]></parameter>
    <parameter name="all" type="System.Boolean"><![CDATA[True]]></parameter>
    <parameter name="open" type="System.Boolean"><![CDATA[False]]></parameter>
    <parameter name="CallContext" type="Ice.Bpm.Context.ContextDataSet">
      <ContextDataSet xmlns="http://www.epicor.com/Ice/300/Bpm/Context">
        <BpmData>
          <SysRowID>00000000-0000-0000-0000-000000000000</SysRowID>
        </BpmData>
      </ContextDataSet>
    </parameter>
  </parameters>
</tracePacket>

I checked “Write Full DataSet”, “Write Call Context DataSet”, and “Write Response Data” in the Tracing Options, however I am thinking it failed before the system could send any data, making me think it is probably malformed data in the table somewhere.

Are you able to do a server trace or get the server log?

How does one go about getting the Server Trace Logs? I assumed the checkbox on the client side would put the server logs in with the client side logs…is that incorrect?

image

I have full access to the server side if needed, I have never had to look at server trace logs before, so I don’t quite know where I would have to go to set that up or retrieve them.

Check the server Event Log first. Go on the server, pull up the Event Log, then check the Epicor folders (more than likely it is in the Epicor App Server) for the error. There might be more info there before doing a server trace. If you don’t find anything, I can detail how to do a server trace.

image

select len(ExpAmt), * from Erp.APInvExp
Where InvoiceLine = 0 and (Len(ExpAmt) > 18)
order by ExpAmt

That will show you the invoices with errors… I have the same error on my system, spent ages going back and forth with support and didn’t get anywhere.

In theory it’s possible to run a SQL update to correct this, but obviously you shouldn’t do that…!

I checked the event logs, but it contained the same thing as the Application Error dialog does when the error pops up on the client.

Should I be concerned that the value that is displayed in the error is not present in the output of your query? :slight_smile:

If @markdamen query does not find the record, you turn on the server trace log through the Admin Console. Don’t forget to turn it off after you are done!!!

Request Fix Program OF_Upd_APInvExp_ExpAmt from Support, quoting 4610SYD.

The program will

  • Select APInvExp records based on the following input parameters: Company, VendorNum, InvoiceNum, InvoiceLine, InvExpSeq
  • Update APInvExp and assign the given values to field ExpAmt, DocExpAmt, Rpt1ExpAmt, Rpt2ExpAmt and Rpt3ExpAmt for the selected records
1 Like

If you run

select len(ExpAmt), * from Erp.APInvExp
Where (Len(ExpAmt) > 5)
order by ExpAmt

You should see your number in the ExpAmt column, thats the issue in a Nutshell. It exceeds the SQL precision, storage and has to be shrunk down. :slight_smile:

@hkeric.wci cool! Bookmarking this for future reference!

Straight out of the KB Article from EpicWeb :slight_smile:

2 Likes

Case opened with Epicor requesting the fix referenced. Thanks, @hkeric.wci !

So I opened the ticket with Epicor, and provided them the information that they needed (records of the bad data, and what the data should be), and they sent back the DataFix. However there was an issue with the DF: They included the currency symbol “$” in the DocExpAmt field, causing it to throw an error when trying to put it into the DB, because $123.45 is an NVARCHAR, not a decimal(17,2) … I explained this to them and asked if they could issue a new DF with properly formatted values…should be a simple thing…but here I am, still waiting. They claimed they had to pass it up to their Tech Support Team for some reason. :man_facepalming:

From their KB it seemed like they had a working DF in the past, looks like someone messed it up with the $ sign :slight_smile:

Yup. And it took me all of 30 seconds to figure that out once I attached it to a debugger, heh. (It is a shame that I can’t find any documentation on those .df files, heh)

I had to find another way around it using the dreaded… :astonished:

The fix never worked, seems they’ve been struggling with this particular one since 2016 when I had trouble with the same data fix!!

**From:** Mark Damen [mailto:MarkDamen@bvdairy.co.uk]
**Sent:** 03 February 2016 13:29
**Subject:** RE: 1975207BRK (DEVSUP FIX AP E10 error in supplier tracker ) Epicor - CR 4610SYD 10.0 700.4 SQL [ASL:0034736]

Hi 

Trying to run that fix, and it reports an error when trying to run the Report:

**Server Side Exception**

Error converting data type nvarchar to numeric.

Exception caught in: Epicor.ServiceModel

**Error Detail**

============

**Description:** Error converting data type nvarchar to numeric.
**Program:** System.Data.dll
**Method:** OnError
**Original Exception Type:** SqlException
**SQL Procedure:** _DS_OF_Upd_APInvExp_ExpAmt_1975207BRK
**SQL Line Number:** 928
**SQL Error Number:** 8114
**Framework Method:** LoadFromReader
**Framework Line Number:** 0
**Framework Column Number:** 0
**Framework Source:** LoadFromReader at offset 181 in file:line:column <filename unknown>:0:0
111
1 Like