Need help with formula: Calculating subtotals in offers (using Adobe Livecycle Designer) | Community
Skip to main content
Level 2
November 24, 2021
Solved

Need help with formula: Calculating subtotals in offers (using Adobe Livecycle Designer)

  • November 24, 2021
  • 1 reply
  • 651 views

Hi community,

I'm just trying to create a xdp template for a customer. I am a total beginner when it comes to Adobe. Everything works fine except the subtotal field. It would be great if you could help me out with the right formula. Here's what I got so far...

Table design:

"Euro" field (DecBetragNetto): visible, decimal field, read only, binding works
"Dezimalfeld" field (subtotal field named "Sum"): visible, decimal field, calculated - read only, no data binding

Page structure:

 

Output:

This is just an example output screenshot which calculates the sum of line 1.* I thought that my problem could be solved using Sum(xfa.resolveNode("FormQuoteNotification.bdyPage1.SubFrmTble.Table1.Row1[*].DecBetragNetto[*]")) but the output field stays empty.

Please help.

 

*Formula: Sum(xfa.resolveNode("FormQuoteNotification.bdyPage1.SubFrmTble.Table1.Row1.DecBetragNetto"))

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mayank_Tiwari

You need to execute a loop through all the table rows like this and calculate the Total, something like this in JS:

 

 

var rows = this.resolveNodes("FormQuoteNotification.bdyPage1.SubFrmTble.Table1.Row1[*]");
total = 0;
for(var i =0; i<rows.length;i++)
{
total= total+rows.item(i).DecBetragNetto.rawValue;
}
FormQuoteNotification.bdyPage1.SubFrmTble.sum.rawValue=total;

1 reply

Mayank_Tiwari
Adobe Employee
Mayank_TiwariAdobe EmployeeAccepted solution
Adobe Employee
November 30, 2021

You need to execute a loop through all the table rows like this and calculate the Total, something like this in JS:

 

 

var rows = this.resolveNodes("FormQuoteNotification.bdyPage1.SubFrmTble.Table1.Row1[*]");
total = 0;
for(var i =0; i<rows.length;i++)
{
total= total+rows.item(i).DecBetragNetto.rawValue;
}
FormQuoteNotification.bdyPage1.SubFrmTble.sum.rawValue=total;