File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Server-Side Components/Background Scripts/Duplicate Finder Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 11// Update ONLY below values to find duplicates
2- var tableName = 'sys_user ' ; // ADD: Table you want for duplicates
3- var fieldName = 'email ' ; // ADD: Field that you want to check for duplicates
2+ var tableName = 'incident ' ; // ADD: Table you want for duplicates
3+ var fieldName = 'short_description ' ; // ADD: Field that you want to check for duplicates
44
55findDuplicates ( tableName , fieldName ) ;
66
@@ -17,12 +17,9 @@ function findDuplicates(tableName, fieldName) {
1717 }
1818
1919 // Check if field exists
20- var fieldGr = new GlideRecord ( 'sys_dictionary' ) ;
21- fieldGr . addQuery ( 'name' , tableName ) ;
22- fieldGr . addQuery ( 'element' , fieldName ) ;
23- fieldGr . query ( ) ;
24-
25- if ( ! fieldGr . next ( ) ) {
20+ var gr = new GlideRecord ( tableName ) ;
21+ gr . initialize ( ) ;
22+ if ( ! gr . isValidField ( fieldName ) ) {
2623 gs . print ( 'No field called "' + fieldName + '" on the "' + tableName + '" table.' ) ;
2724 return ;
2825 }
You can’t perform that action at this time.
0 commit comments