- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 07:48 PM
i have a requirement to do checking, to ensure multirow variable set is filled in by fulfiller and its not empty before closing the task.
i created a BR and it works fine. however, once the mrvs is filled, the task still cant be closed cause in ritm side, its considered empty.
how to fix this, thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 10:04 PM
this worked for me
function onSubmit() {
//Type appropriate comment here, and begin script below
if(g_form.getValue('state') == '3'){
var json = g_form.getValue('variables.servers'); // servers is my mrvs variable set name
var parsedData = JSON.parse(json);
if(parsedData.length == 0){
alert('The multi-row variable set must not be empty before closing the task.');
return false;
}
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 10:02 PM
the issue is when you click Add it doesn't add the record into the table "sc_multi_row_question_answer"
So please use onSubmit client script and get the MRVS JSON and then check if its empty
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 10:03 PM
if i use onSubmit client script, then is the BR no longer required?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 10:14 PM
no business rule, only client script onsubmit normal one on sc_task
Ensure you enhance it so that it works only for your catalog item and not always
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 09:44 PM
Hi @Hafila Hatta , you will have to save the multi row variable set first and then close it in next update. Otherwise, the multi row variable set values are not inserted in 'sc_multi_row_question_answer', so throwing the error and aborting the action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 09:52 PM
is there a way that it can be done simultaneously? unfortunately, we can't expect the fulfiller to save the ticket first before closing.
i managed to this on another catalog item but it was a single variable.