How to set the Quantity and Price Value according to the Records added in multi row variable set in
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2023 04:47 AM
Here i want to set the quantity value according to the records added in the multi row variable set and after setting the quantity the price should also be set according to the Quantity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2023 04:59 AM
Hi @ServicenowDev19,
Try this client script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue) {
var multiRowVariableSet = JSON.parse(g_form.getValue('demo_variable_set')); // Replace "demo_variable_set" with your Variable Set Name. Make sure to replace it with Name and not with Label of Multi Row Variable Set
var numberOfRows = multiRowVariableSet.length;
g_cart.setQuantity(numberOfRows);
}
//Type appropriate comment here, and begin script below
}
​If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.
Regards
Mohan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2023 05:20 AM
This solution is not working for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2023 06:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2023 08:42 PM
I am writing this script in variable set but not working.