Skip to content

Commit 6a22379

Browse files
Conditional Auto-Routing and Dynamic Mandatory Fields (#2512)
* Create Readme.md Description for conditional auto-routing and dynamic mandatory Fields * Uploading ServiceNow Js file Conditional Auto-Routing and Dynamic Mandatory Fields * Rename Conditional_AutoRouting_Dynamic_Mandatory_Fields.txt to Conditional_AutoRouting_Dynamic_Mandatory_Fields.js
1 parent 9645c64 commit 6a22379

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
function onChange(control, oldValue, newValue, isLoading) {
2+
if (isLoading) return;
3+
4+
if (newValue === 'hardware') {
5+
g_form.setMandatory('asset_tag', true);
6+
g_form.setDisplay('asset_tag', true);
7+
g_form.setValue('assignment_group', 'Hardware Support Group');
8+
} else if (newValue === 'software') {
9+
g_form.setMandatory('asset_tag', false);
10+
g_form.setDisplay('asset_tag', false);
11+
g_form.setValue('assignment_group', 'Software Support Group');
12+
} else {
13+
g_form.setMandatory('asset_tag', false);
14+
g_form.setDisplay('asset_tag', true);
15+
}
16+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
If an Incident Category = Hardware, make Asset Tag mandatory and automatically assign to Hardware Support Group.
2+
If Software, assign to Software Support Group and hide Asset Tag.

0 commit comments

Comments
 (0)