- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2023 08:48 PM
Hi All,
I want to make 'contact number' field on incident form to mandatory when incident is created from New Call. And mandatory only on new record and if assignment group is Software. Can someone help me in achieving this functionality.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2023 09:13 PM
Hi @Community Alums ,
try below onchange client script on assignment group
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (g_form.isNewRecord()) {
if (newValue == 'b8ef24616fc331003b3c498f5d3ee434') { //add software group sysid
g_form.setMandatory('contact_number', true); //give contact number backend name
}
}
}
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2023 10:30 PM
We can write onchange clientscript for assignment group and check assignment group is software.
if(g_form.newRecord())
{
if(newValue=='software')
{
g_form.setMandetory('contact _number,true);
}
}
Please mark correct if it is helpful.