Skip to content

Commit 2fce22d

Browse files
Create AbortDuplicates.js
1 parent be1fd1a commit 2fce22d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

AbortDuplicates.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(function executeRule(current, previous /*null when async*/) {
2+
3+
// Add your code here
4+
5+
var gr=new GlideRecord('incident');
6+
gr.addQuery('caller_id',current.caller_id);
7+
gr.addQuery('short_description','CONTAINS','email');
8+
gr.query();
9+
if(gr.next()){
10+
gs.addErrorMessage("You have already created the incident with the similar short description");
11+
current.setAbortAction(true);
12+
}
13+
14+
})(current, previous);

0 commit comments

Comments
 (0)