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
- 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)
- AccountingTransaction(1)
- pyWorkPage
- 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
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.