populate sum of 4 number fiels in other field dynamically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2024 01:27 AM
Hi,
i have a requirement that in the for there r 4 fields A,B,C,D currency fields or number fiels when i enter this values in the form it should do sum of all these a+b+c+d and populate in other field called E before saving form it self it should calculate and populate

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2024 01:36 AM - edited ‎05-02-2024 01:37 AM
Hi @dixitreddy ,
Please refer below script.
For Before Business Rule
var fieldA = current.getValue('field_a');
var fieldB = current.getValue('field_b');
var fieldC = current.getValue('field_c');
var fieldD = current.getValue('field_d');
var e = fieldA + fieldB+ fieldC + fieldD;
current.setValue('fieldE', e);
For Client Script
var fieldA = g_form.getValue('field_a');
var fieldB = g_form.getValue('field_b');
var fieldC = g_form.getValue('field_c');
var fieldD = g_form.getValue('field_d');
var e = fieldA + fieldB+ fieldC + fieldD;
g_form.setValue('fieldE', e);
Please mark my answer correct and helpful if this work for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2024 01:39 AM
using client script we cant add more than two values!
script u mentiond for business rule works without saving form(sum of values will reflect without saving)?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2024 01:43 AM
Hi @dixitreddy ,
1. You can do like add two valeus and store the sum in seprate variable and than do that for another variable
2. using business rule you have to save the form after that it reflect to the sun in field E
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2024 01:53 AM
i need the sum before saving form