AR Invoice Printing Error

We are getting error when printing certain AR Invoice. Any one can suggest

Program Ice.Services.Lib.RunTask when executing task 920920 raised an unexpected exception with the following message: RunTask:
System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(TimeSpan value)
at System.Data.SqlTypes.SqlDateTime.FromDateTime(DateTime value)
at Microsoft.Data.SqlClient.MetaType.FromDateTime(DateTime dateTime, Byte cb)
at Microsoft.Data.SqlClient.TdsParser.WriteUnterminatedValue(Object value, MetaType type, Byte scale, Int32 actualLength, Int32 encodingByteSize, Int32 offset, TdsParserStateObject stateObj, Int32 paramSize, Boolean isDataFeed)
at Microsoft.Data.SqlClient.TdsParser.TDSExecuteRPCAddParameter(TdsParserStateObject stateObj, SqlParameter param, MetaType mt, Byte options, SqlCommand command, Boolean isAnonymous)
at Microsoft.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, IList1 rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource1 completion, Int32 startRpc, Int32 startParam)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Ice.Core.RptBase.DatabaseReportDataStorage.WriteRow(IDataSource dataSource, IRow row) in C:_releases\ICE\ICE5.1.100.10\Source\Server\Internal\Lib\TaskLib\RptBase\DatabaseReportDataStorage.cs:line 114
at Ice.Core.RptBase.ReportRowDataWriter.WriteRow(IRow row) in C:_releases\ICE\ICE5.1.100.10\Source\Server\Internal\Lib\TaskLib\RptBase\ReportRowDataWriter.cs:line 60
at Erp.Internal.AR.ARInvForm.DoCustomerCalculations() in C:_releases\ERP\ERP12.1.100.10\Source\Server\Internal\AR\ARInvForm\ARInvForm.cs:line 1975
at Erp.Internal.AR.ARInvForm.DoInvcHeadCalculations() in C:_releases\ERP\ERP12.1.100.10\Source\Server\Internal\AR\ARInvForm\ARInvForm.cs:line 3780
at Erp.Internal.AR.ARInvForm.RunProcess(Int64 instanceTaskNum, String outputFileName) in C:_releases\ERP\ERP12.1.100.10\Source\Server\Internal\AR\ARInvForm\ARInvForm.cs:line 1309
at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:_releases\ICE\ICE5.1.100.10\Source\Server\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 71
at Ice.Hosting.TaskCaller.ExecuteTask() in C:_releases\ICE\ICE5.1.100.10\Source\Server\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 62
at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:_releases\ICE\ICE5.1.100.0\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 57
at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:_releases\ICE\ICE5.1.100.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 349

It’s coming from a bad date on your invoice or a related record. Check for something like 01/01/0001. If you use uBAQs or paste updates from Excel you can get poorly formatted dates.

2 Likes

BadDates

2 Likes

I have checked the date and all looks good.

Have you looked at dates on all related records in the RDD? Any bad date can cause it to fail. There are a number of posts on here for the same error and where people found related records with incorrect dates.

Likely suspects: ShipDate in ShipHead…EntryDate and ReceiptDate in DropShipHead (if you do dropship orders). Have also seen that cause ASNs to go sideways.

3 Likes

we found the issue. The custom date column in customer value is 0205-08-24.

2 Likes

@chaddb gave you the solution not me LOL…but it’s good that you found the problem.

2 Likes