
- 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
‎02-02-2023 08:06 PM
Hi @Community Alums ,
it will check only whether it is new record or not isNewRecord() will not check what module you are using.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2023 07:29 AM
Hi @Community Alums ,
If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.
If not reply and share details.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2023 11:07 AM
I have tried about code but it is not meeting my requirement. It is making contact number mandatory when we are creating incident from "Create New" module but its not making mandatory if incident is created from New Call>Call type>Incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2023 05:38 AM
Can you check the URL values to determine if the incident is created from "Create New" module or "New Call" module , rest of the code is already there. Also can you paste exact screenshots to let us know what exactly is the process you are following to create the incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2023 01:03 AM
Hi @Community Alums ,
As per my script if it is a new record it will set contact number mandatory.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar