I’m having trouble printing a customer statement, I’ve turned on the trace log on the server and below is the error related to when I try and print
<IceAppServer msg="Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask: The error related to invoice 206343
Stack Trace:
 at Erp.Internal.AR.CustomerStatement.DoCustomerCalculations(AgingRptFmt ipAgingRptFmt, String ipAgeBy, Nullable`1 ipBeginDate, Int32 ipCustNum) in C:\_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 1611
 at Erp.Internal.AR.CustomerStatement.InternalRunProcess() in C:\_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 702
 at Ice.Core.TaskBase`1.StartProcess(Int64 instanceTaskNum, String outputFileName) in C:\_Releases\ICE\ICE3.2.400.13\Source\Server\Internal\Lib\TaskLib\TaskBase\TaskBase.cs:line 47
 at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:\_Releases\ICE\ICE3.2.400.13\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 98
 at Ice.Hosting.TaskCaller.ExecuteTask() in C:\_Releases\ICE\ICE3.2.400.13\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 57
 at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:\_Releases\ICE\ICE3.2.400.0\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63
 at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_Releases\ICE\ICE3.2.400.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 592
Inner Exception:
Object reference not set to an instance of an object.
Stack Trace:
 at Erp.Internal.AR.CustomerStatement.AgeInvoice(AgingRptFmt ipAgingRptFmt, InvcHead ipInvcHead, String ipAgeBy, Nullable`1 ipBeginDate) in C:\_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 1197
 at Erp.Internal.AR.CustomerStatement.DoCustomerCalculations(AgingRptFmt ipAgingRptFmt, String ipAgeBy, Nullable`1 ipBeginDate, Int32 ipCustNum) in C:\_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 1607" />
I’ve opened the Invoice that is causing the error and cannot see anything wrong with it, The invoice prints with no errors
Can anyone see what the error may be from the log above??
Apologies in case I’m asking you to suck eggs here, do statements for other customers function?
I’m assuming for the faulty report instance with the specific parameters no data is being stored in the report temp tables?
I would do a quick comparison to another invoice header against 206343 and see if there are any anomalies that you can see quickly at a column level. If you are 100% satisfied that there are not differences (check for nonprintable characters as well).
At least that’s where I would start.
The error data you got from the serverlog file or from system manager?
EDIT
Missed the Testing part. Kudos for testing. Do you have customisations on the statement from 10.2.400. If so then make sure that the RDD hasn’t been messed up.
If the statement is custom, is it using a custom version of the RDD? If it is then you may need to compare against the 10.2.700 vs your custom one.
This is the full dump from the System Monitor for when I try to print to Excel, I get the same when I try Word or PDF
If I hit generate only, I get the same error
Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask: The error related to invoice 206343
Stack Trace:
at Erp.Internal.AR.CustomerStatement.DoCustomerCalculations(AgingRptFmt ipAgingRptFmt, String ipAgeBy, Nullable`1 ipBeginDate, Int32 ipCustNum) in C:\_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 1611
at Erp.Internal.AR.CustomerStatement.InternalRunProcess() in C:\_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 702
at Ice.Core.TaskBase`1.StartProcess(Int64 instanceTaskNum, String outputFileName) in C:\_Releases\ICE\ICE3.2.400.13\Source\Server\Internal\Lib\TaskLib\TaskBase\TaskBase.cs:line 47
at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:\_Releases\ICE\ICE3.2.400.13\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 98
at Ice.Hosting.TaskCaller.ExecuteTask() in C:\_Releases\ICE\ICE3.2.400.13\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 57
at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:\_Releases\ICE\ICE3.2.400.0\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63
at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_Releases\ICE\ICE3.2.400.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 592
Inner Exception:
Object reference not set to an instance of an object.
Stack Trace:
at Erp.Internal.AR.CustomerStatement.AgeInvoice(AgingRptFmt ipAgingRptFmt, InvcHead ipInvcHead, String ipAgeBy, Nullable`1 ipBeginDate) in C:\_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 1197
at Erp.Internal.AR.CustomerStatement.DoCustomerCalculations(AgingRptFmt ipAgingRptFmt, String ipAgeBy, Nullable`1 ipBeginDate, Int32 ipCustNum) in C:\_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 1607
I’m with @Hally on there being something smurfed on the records related to that invoice.
Make a BAQ of the InvcHead table for just that customer. Include all columns. Then export the BAQ results to Excel and do a row by row comparison of all the fields, looking for anything in the row of the problematic invoice that is different than the other invoices. I’d focus on the date fields (because of the whole "Nullable`1" thing in a date field).
If nothing turns up, repeat for the each of the other Invoice tables (InvcDtl, InvcMsc, InvcTax, etc…)
edit
Does the problem happen for any of the Age By selections (Due Date, Invoice Date, or Apply Date)?
Ok, try the following in SQL or the equivalent BAQ
Select * from Erp.CashDtl detail
left join Erp.CashHead header
ON detail.Company = header.Company
AND detail.GroupID = header.GroupID
AND detail.HeadNum = header.HeadNum
where detail.Company = ‘YourCompany’
AND detail.InvoiceNum = 206343
AND detail.Posted = 1
AND detail.TranType = ‘CMemo’
Basically, there is a CashDtl associated with the invoice that is somehow orphan without a parent CashHead.
It seems to be corrupted data, CMemo transactions are created by Apply Credit Memo and it should have a corresponding CashHead record.