Customer Statement will not print - problem with Invoice

Hello All,

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&#xD;&#xA;Stack Trace:&#xD;&#xA;   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&#xD;&#xA;   at Erp.Internal.AR.CustomerStatement.InternalRunProcess() in C:\_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 702&#xD;&#xA;   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&#xD;&#xA;   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&#xD;&#xA;   at Ice.Hosting.TaskCaller.ExecuteTask() in C:\_Releases\ICE\ICE3.2.400.13\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 57&#xD;&#xA;   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&#xD;&#xA;   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&#xD;&#xA;Inner Exception:&#xD;&#xA;Object reference not set to an instance of an object.&#xD;&#xA;Stack Trace:&#xD;&#xA;   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&#xD;&#xA;   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??

The “Nullable`1” part doesn’t look right. Should be a type for the parameter ipBeginDate

Does it print in any report style?

Hello @ckrusen ,

The Invoice prints on any form that I select
The Statement does not print on any form

There are no errors on any other customer statements

The nullable bit was the only thing that stood out to me too

Hello @LBARKER,

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.

Cheers
Simon

Hello @Hally

This is in our live instance of 10.2.400

And nothing has changed for the statement? Report style, RDD or RDL?

Does the “report” process successfully, if the output format is to Excel, or Word? Or even just processing it only?

@Hally ,

Nothing has changed in regard to the Report Style or RDD or RDL

The dump below says that the error is related to an invoice, strange thing is the invoice prints without a problem

@ckrusen

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

So are you 100% sure there is nothing wrong with the terms code on either the customer or the invoice, or perhaps a terms code setup has been changed?

2 Likes

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)?

Go to Actions → Clear Defaults

1 Like

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.

@Jonathan, Ok I built the BAQ, you are correct, there is a CashDtl but not a CashHead for that transaction,

Is there any way to remove it, the CM has been posted

If you have an orphaned Detail record you should contact Epicor Support for a kosher Data Fix… and thier confirmation.

It should be the other way around, the CashHead should exist. The CashDtl is used for balances so removing it would cause more issues.

As rick mentioned support should provide a fix, although I’m still curious as to how it happened.

Refer to knowledge articles KB0052186 or KB0104731

I’ve no idea how it happened… but I’m not one bit surprised, the team here a quite good at finding things to break

A few of the users work remotely and connect via VPN, maybe a few packets got dropped on the way in

Ticket Lodged: CS0002469394

1 Like

Thanks, @Hally @ckrusen @hkeric.wci @Rick_Bird and @Jonathan for offering suggestions, I’ll keep you posted when I get a resolution

1 Like

Yep I forgot that one. That’s a definite to have on the checklist of reporting errors.

Glad you got to the bottom of it.

Hey Lawson
I’m not sure if you got this one working, but apologies if you have already checked, but is the customer flagged to receive Statements?