Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
31d7cdd
Add script to display user mentions in Service Portal
raghavs046 Oct 22, 2025
c06f874
Delete Modern Development/Service Portal Widgets/My Mentioned Items d…
raghavs046 Oct 22, 2025
f1473d6
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 22, 2025
1e5fce5
Create script.js
raghavs046 Oct 22, 2025
f368a8d
Delete Modern Development/Service Portal Widgets/My Mentioned Items d…
raghavs046 Oct 22, 2025
f2ce7d2
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 23, 2025
c3f00eb
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 23, 2025
5752145
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 23, 2025
df002e4
Create script.js
raghavs046 Oct 23, 2025
31be0ba
Delete Server-Side Components/Scheduled Jobs/Retire Rating 1 Articles…
raghavs046 Oct 23, 2025
db7b48d
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 24, 2025
dd6ade3
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 24, 2025
6579f1b
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 25, 2025
02b9a72
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 27, 2025
8e55fcb
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 27, 2025
a59cfcb
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 28, 2025
3b8d029
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 28, 2025
6065b0b
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 28, 2025
ba22acd
Merge branch 'ServiceNowDevProgram:main' into main
raghavs046 Oct 31, 2025
0286266
Create script.js
raghavs046 Oct 31, 2025
b05761d
Update script.js
raghavs046 Oct 31, 2025
35f3c0b
Create README.md
raghavs046 Oct 31, 2025
42a9e16
Update README.md
raghavs046 Oct 31, 2025
14b8d00
Update script.js
raghavs046 Oct 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**Details**

This is a on change client script on sys_template table. This script will restrict users to select defined fields while template creation.
Type: OnChange
Field: Template
Table: sys_template

**Use Case**

There is an OOB functionality to restrict fields using "**save as template**" ACL, but it has below limitations:
1. If the requirement is to restrcit more number of fields (example: 20), 20 ACLs will have to be created.
2. The ACls will have instance wide effect, this script will just restrict on client side.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Type: onChnage
Table: sys_template
Field: Template
*/
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (g_form.getValue('table') == 'incident') { // table on which sys_template is being created.
var fields = ['active', 'comments']; // array of fields to be restricted while template creation.
for (var i = 0; i < fields.length; i++) {
if (newValue.indexOf(fields[i]) > -1) {
alert("You Cannot Add " + fields[i]); // alert if user selects the restricted field.
var qry = newValue.split(fields[i]);
g_form.setValue('template', qry[0] + 'EQ'); // set the template value to previous values (oldValue does not work in this case).
}
}
}
}
Loading