Restrict the Task state field from the list view
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2024 11:47 PM
I need to restrict the state field. If mandatory fields are not fillled or empty in task record. we not allow to close complete from Iist View. And need to show the alert or error message in current RITM.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2024 05:21 AM
Hi @mastanbabuk
You need to write the OncellEdit Client script for this.
*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2024 06:26 AM
Yes I have written the On Cell edit Scripts. But it seems its not working
var manDat = ['publisher_part_number', 'po_number', 'vendor'];
var taskGr = new GlideRecord('sc_task');
if (taskGr.get(sysIDs[0])) {
for (var i = 0; i < manDat.length; i++) {
var Fields = manDat[i];
if (taskGr.isValidField(Fields) && taskGr[Fields].nil()) {
if (newValue == 'close complete') {
g_form.addErrorMessage('You cannot close or complete this task until all mandatory fields are filled.');
callback(false);
return;
}
}
}
}
callback(true);