Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@
This Script under code_snippet.js block users from saving a CI with a duplicate name but different class.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Business Rule to Block users from saving a CI with a duplicate name but different class
// Before Insert Business Rule on cmdb_ci table
(function executeRule(current, previous /*null when async*/) {

var ci = new GlideRecord('cmdb_ci');
ci.addQuery('name', current.name);
ci.addQuery('sys_id', '!=', current.sys_id);
ci.query();

if (ci.next()) {
gs.addErrorMessage('A Configuration Item with this name already exists!');
current.setAbortAction(true);
}

})(current, previous);
Loading