- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2019 12:38 PM
I have a list of records in a related list . I would like to make couple of fields mandatory when the user tries to change the state to completed in list edit . I never used a on cell edit script . Can anyone help me with this ??
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2019 08:40 PM
Configure data policy to make field mandatory in list view.
https://docs.servicenow.com/bundle/london-platform-administration/page/administer/field-administration/task/t_CreateADataPolicy.html
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2019 08:40 PM
Configure data policy to make field mandatory in list view.
https://docs.servicenow.com/bundle/london-platform-administration/page/administer/field-administration/task/t_CreateADataPolicy.html
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 12:02 PM
FYI: this is the Vancouver link for that info: https://docs.servicenow.com/bundle/vancouver-platform-administration/page/administer/field-administr...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2019 08:55 PM
Hi,
Create a BEFORE Business rule with filter condition as state | Changes to | Pending,close compelte with script as
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (current.work_notes.getDisplayValue() == null) {
//do something
current.setAbortAction(true);
gs.addInfoMessage('PASS YOUR CUSTOM MESSAGE HERE');
}
})(current, previous);
Please mark reply as Helpful/Correct, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2019 08:48 AM
Why do you need to write script if this is possible with configuration?
It doesn't make sense to maintain code for this simple requirement which is possible with configuration.
Regards,
Sachin