- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 09:58 AM - edited ‎08-29-2024 10:55 AM
I need to flag the the duplicate field values in a table with a red dot using field style, I tried using script include to write custom query but it flagging all the fields.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2024 07:36 AM
Hi
Please try adding one parameter in the function
I have tried for incident short description field
var DuplicateShortdescription = Class.create();
DuplicateShortdescription.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getDuplicateValue: function(shortDesc) {
var gr = new GlideRecord('incident');
gr.query();
var count = 0;
while(gr.next()) {
if (gr.short_description == shortDesc) {
count++;
}
}
if (count > 1) {
return true;
} else {
return false;
}
},
type: 'DuplicateShortdescription'
});
Thanks & Regards
Sejal Chavan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2024 07:36 AM
Hi
Please try adding one parameter in the function
I have tried for incident short description field
var DuplicateShortdescription = Class.create();
DuplicateShortdescription.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getDuplicateValue: function(shortDesc) {
var gr = new GlideRecord('incident');
gr.query();
var count = 0;
while(gr.next()) {
if (gr.short_description == shortDesc) {
count++;
}
}
if (count > 1) {
return true;
} else {
return false;
}
},
type: 'DuplicateShortdescription'
});
Thanks & Regards
Sejal Chavan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2024 07:46 AM
Hi,
I would really suggest NOT doing this on field styles as it will add a lot of load on your list when it loads.
It will scan the whole table for each record each time.