Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Opening Mail attachment from Case throws Null Pointer exception



On opening a mail attached to a Case from the Case Narrative section a Null Pointer exception is thrown.

Error Messages

Exception Section 'DateTime-Default' execution error on page '' of class 'Data-Corr-Email'. : null
at com.pegarules.generated.html.ra_stream_show_4d9c155a321c13102a4a3fa848b71885.execute(

Caused by: java.lang.NullPointerException
at com.pegarules.generated.html.ra_stream_show_4d9c155a321c13102a4a3fa848b71885.execute(
... 64 more

Steps to Reproduce

  1. Add an attachment to a case.
  2. 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.
  3. Open the Case Narrative section.
  4. Try to open the attached mail.
  5. 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.


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



Published April 25, 2017 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us