I'm working on configuring a formula in Electronic Reporting and need some help. Specifically, I want to modify the formula so that if a value is empty, it displays as blank instead of causing an error.
Currently, the formula in Cell<Prepayments_Date_Value> = model.CustomerTransaction.Settlement.OffsetTransDate is set as:
model.CustomerTransaction.Settlement.OffsetTransDate
The issue I'm facing is that if a Free Text invoice is not settled, users are unable to view invoices due to the following error:
"Evaluating binding of format component Folder/Free text invoice/Invoice/Totals/Prepayments/Prepayments_Date_Value."
"Evaluating expression for path 'model/CustomerTransaction/Settlement/OffsetTransDate'. List is empty at 'model/CustomerTransaction/Settlement'"
I've attempted a few solutions, but none have worked. Can anyone suggest a formula that would handle empty values properly and prevent this error?
When working with ER, you need to consider both model mapping and the format designer. In this case, the model mapping uses the CustSettlement table for mapping. This means it can be empty if there are no records in this table, which explains the error message you received.
I recommend following this post by Microsoft to gain a better understanding of how to troubleshoot such issues when dealing with Record or Record list:
Inspect the configured ER component to prevent runtime issues - Finance & Operations | Dynamics 365 | Microsoft LearnAND(COUNT(model.CustomerTransaction.Settlement)>0, model.CustomerTransaction.SettleAmountCur<>0)
. This means that the node will be enabled if there are transactions in the Settlement and the amount is not zero, which should be sufficient.Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,902 Super User 2024 Season 2
Martin Dráb 229,297 Most Valuable Professional
nmaenpaa 101,156