Support Article
Opening Mail attachment from Case throws Null Pointer exception
SA-36951
Summary
On opening a mail attached to a Case from the Case Narrative section a Null Pointer exception is thrown.
Error Messages
Exception com.pega.pegarules.pub.PRRuntimeException: Section 'DateTime-Default' execution error on page '' of class 'Data-Corr-Email'. : null
at com.pegarules.generated.html.ra_stream_show_4d9c155a321c13102a4a3fa848b71885.execute(ra_stream_show_4d9c155a321c13102a4a3fa848b71885.java:350)
...........
Caused by: java.lang.NullPointerException
at com.pegarules.generated.html.ra_stream_show_4d9c155a321c13102a4a3fa848b71885.execute(ra_stream_show_4d9c155a321c13102a4a3fa848b71885.java:291)
... 64 more
Steps to Reproduce
- Add an attachment to a case.
- Then send out a mail using the Send Mail smart shape and choose to send all attachments on the case here. Also, select any particular category for the attachment. Issue is fixed when the "All" categories are chosen.
- Open the Case Narrative section.
- Try to open the attached mail.
- Null Pointer exception is thrown.
Root Cause
A defect in Pegasystems’ code or rules: The AttachmentList page is no more used now. Hence we need to use the pyAttachments page under the pyWorkPage for the attachments reference.
Resolution
Perform the following local-change: Override the Data-Corr-Email.SHOW html rule ( Available), as mentioned below:
Replace the code under the following WHEN rule, line in Green is the new changes
<pega:when test='.pyAttachmentCategories != ""'>
<%
String serverURL = tools.findPage("pxThread").getString("pxReqURI"); // Get the requestor URL
ClipboardProperty AttachmentListPageList = tools.findPage("pyWorkPage").getProperty(".pyAttachments");// Get the page that has the WO attachments
String attachmentsInEmail[] = tools.getProperty(".pyAttachmentCategories").toString().split(","); // The Email attachments are seperated by commas
%>
</pega:when>
Published April 25, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.