- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2023 08:46 AM
Hi all. On my record producer, I have a multi row variable set for expense items. Each expense item has a total for that row. What I would like to do is add a Grand Total to the form which sums up all the totals for each expense item, and changes each time an expense item is added, deleted, or modified. For example, if one item (Coffee) is $40.80 and another item (Donuts) is $45.00, then the grand total on the form would be $85.80. If I click the X to remove Donuts, then the grand total would recalculate to $40.80. I have put some code in the onSubmit of the variable set, but it has no visibility to other rows of the variable set, so I can't calculate anything. How do I access all of the rows of the multi row variable set when a change is made? Thanks for your assistance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2023 09:03 AM
This post contains a solution for this scenario:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2023 09:03 AM
This post contains a solution for this scenario:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2023 11:37 AM
Thank you Brad. This worked with one caveat. The line of code to set the variable (i.e.
g_form.setValue('count',parseInt(sum));
does not work. I was unsuccessful using this technique to set a record producer variable from a widget, and from my googling, so were many others. Instead, I did the following:
Replace the code above with: c.data.count = parseInt(sum)
Put the following into the Body HTML Template of the widget:
<div>
<input type="text" value ={{c.data.count}} readonly>
</div>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 01:55 AM
Hi Michael, the whole script I have tried in widget and tagged the widget to the catalog item, still it doesn't work for me. Can you please write here all the steps in detail what worked for you.
Thank you in advance.
Regards
Smita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2025 04:22 AM
Hi Smita, Were you able to figure out the issue? Even for me this seems to be not working, the Sum keeps posting as NaN,
Could you please let me know? Thanks in advance