How to setup MRVS Minimum row count?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2025 03:44 PM
From the Thread :
Hi All,
I wrote the same code, but it is not working.
Can you pelase check the issue:
function onSubmit() {
var bulk = g_form.getValue('is_this_a_bulk_request_for_than_5_account');
var mrvs = g_form.getValue('user_details_bulk'); //mrvs1
var mrvs2 = g_form.getValue('user_details_remove_bulk'); //mrvs2
var parser = JSON.parse(mrvs);
var parser2 = JSON.parse(mrvs2);
if(parser.legth < 2 || parser2.length < 2)
{
g_form.addErrorMessage('Oops, you have submitted a bulk request for 1 user. Please either add additional users; or if your request is for 1 user, select the option of "1 account".');
return false;
}
}
It just throws the Javascript error.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2025 07:04 PM
your script is wrong.
some correction here
function onSubmit() {
var bulk = g_form.getValue('is_this_a_bulk_request_for_than_5_account');
var mrvs = g_form.getValue('user_details_bulk'); //mrvs1
var mrvs2 = g_form.getValue('user_details_remove_bulk'); //mrvs2
var parser = JSON.parse(mrvs);
var parser2 = JSON.parse(mrvs2);
if (parser.length < 2 || parser2.length < 2) {
g_form.addErrorMessage('Oops, you have submitted a bulk request for 1 user. Please either add additional users; or if your request is for 1 user, select the option of "1 account".');
return false;
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader