- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 10:16 AM
Hello, I have the below multi row variable set. How can I have the "Total Weight" and "Total Price" automatically calculate once "Unit Weight" is populated.
"Total Weight" = "Quantity" x "Unit Weight"
"Total Price" = "Quantity" x "Unit Price"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 10:42 AM - edited 05-22-2025 10:43 AM
Hi,
You can achieve this by utilizing onChange client script in MRVS
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var quauntiy = g_form.getValue('u_quantity');;
var unit_price = g_form.getValue('u_unit_price');
var unit_weight = g_form.getValue('u_unit_weight');
if (unit_weight != '') {
var total_weight = quauntiy * unit_weight;
var total_price = quauntiy * unit_price;
g_form.setValue('u_total_weight', total_weight);
g_form.setValue('u_total_price', total_price);
} else {
g_form.showFieldMsg('u_unit_weight', '...Your own message'); // optional step
}
}
Mark as correct and helpful if it solved your query.
Regards,
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 10:42 AM - edited 05-22-2025 10:43 AM
Hi,
You can achieve this by utilizing onChange client script in MRVS
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var quauntiy = g_form.getValue('u_quantity');;
var unit_price = g_form.getValue('u_unit_price');
var unit_weight = g_form.getValue('u_unit_weight');
if (unit_weight != '') {
var total_weight = quauntiy * unit_weight;
var total_price = quauntiy * unit_price;
g_form.setValue('u_total_weight', total_weight);
g_form.setValue('u_total_price', total_price);
} else {
g_form.showFieldMsg('u_unit_weight', '...Your own message'); // optional step
}
}
Mark as correct and helpful if it solved your query.
Regards,
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 04:48 PM
Could you mark my response as correct or helpful if it solved your query and close the thread so that it benefits future readers.
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 10:44 AM
Add a client script on your MRVS that runs when Unit Weight is changed. In the client script, set the values of Total Weight and Total Price.