how I can avoid insertion of duplicate record in async insert business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @akkk,
Without a description, it’s difficult to answer meaningfully.....
Is your question more as preemptive approach (you want to actively avoid it) or the duplicates are already being created and you want to stop it?
Please provide more details and also the configurations that you did. The easiest way to avoid would be having proper triggering conditions and eventually some checks on the script. It really depends on what you want to achieve and that's not clear.
100 % GlideFather experience and 0 % generative AI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
If I understand what you're asking, then I'm not sure if this is possible.
Given that do cannot control when an async business rule fires, you cannot know beforehand if a duplicate record exists or not.
Please elaborate on your use case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @akkk ,
why are you using async business rule? This requirnment can be fulfilled by before insert business rule .Its depends on which field you are comparing .
Lets assume you are comparing duplication on short_description:
so you can use before insert business rule
var gr = new GlideRecord('incident');
gr.addQuery('short_description', current.short_description);
gr.query();
if (gr.next()) {
gs.addErrorMessage('Incident with same Short Description already exists');
current.setAbortAction(true);
}
If this helps you then mark it as helpful and accept as solution.
Regards,
Aditya,
Technical Consultant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @akkk ,
I hope you are doing well . Does my response helps you ?
If my response helps you then mark it as helpful and accept as solution. This will helps further future queries.
Regards,
Aditya,
Technical Consultant
