- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2023 12:39 AM
Hi, can anyone help me with this
I have a multi variable set in catalog form , in that when same group field values are selected then an alert should be populated.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2023 12:52 AM
Hello @Lally
var mrvs = g_service_catalog.parent.getValue('mrvs'); //MRVS internal name
if (mrvs.length > 2) {//native UI returns [] for empty MRVS value which causes a parsing error
var obj = JSON.parse(mrvs);
for (var i=0; i<obj.length; i++) {
if (obj[i].variable_name = g_form.getValue('variable_name') {
alert('Duplicate value');
return false;
}
}
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2023 12:42 AM
Hello @Lally ,
So basically you have a field called group and you add a row with one group selected .Then you add a second row and if they select the same group you need to get an alert?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2023 02:03 AM
yes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2023 12:52 AM
Hello @Lally
var mrvs = g_service_catalog.parent.getValue('mrvs'); //MRVS internal name
if (mrvs.length > 2) {//native UI returns [] for empty MRVS value which causes a parsing error
var obj = JSON.parse(mrvs);
for (var i=0; i<obj.length; i++) {
if (obj[i].variable_name = g_form.getValue('variable_name') {
alert('Duplicate value');
return false;
}
}
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh