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

Declare Expression is not working in Pega 7.1.7

SA-18901

Summary



A Claim work object contains a page list of AccountingTransaction items, each of which consists of one or more AccountingEntries. A Declare Expression has been created to get the sum total of debit accounting entries for each AccountTransaction; however, the Declare Expression is giving the total for all of the AccountingEntries items in the Claim and not just for a single AccountingTransaction.


Error Messages



Not Applicable.


Steps to Reproduce

  1. Create work and data classes so you have the following page structure.
    • ​​pyWorkPage
      • AccountingTransaction(1)
        • AccountingEntries(1)
        • AccountingEntries(2)
      • AccountingTransaction(2)
        • AccountingEntries(1)
        • AccountingEntries(2)
  2. Create a Declare Expression to sum the amounts from the AccountingEntries when the type is debit.
    • ​​Set TotalAmount = Sum of Parent.AccountingTransaction().AccountingEntries().Amount using entries in which @(Pega-RULES:String).equalsIgnoreCase(.DebitCredit, "Debit").


Root Cause



The condition used to sum the values was incorrect.

Resolution

Perform the following local-change:

Change the sum condition from "Parent.AccountingTransaction().AccountingEntries().Amount" to ".AccountingEntries().Amount".

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

100% 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