Prevent Duplicate Records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2023 03:09 AM
Hi All,
Kindly, help with your inputs for below requirements.
Catalog Item Variables:
1. Groups
2. Modules: Aa and Bb (only 2 choices)
This is creating a record on Table: (Table Name = Demo)
Field on a Table:
1. Module (Reference)
Condition: Once 'Aa' is selected on a catalog form, it will map to Module field on a table with "Post 1" value.
if "Bb" selected on catalog form, it will map "Post 2" value on table. (This is done using flow designer)
Requirement:
If there are existing records on table with group name = ABC and Modules = Aa and Bb, then it should not allow to create another record.
i.e., if there are already records created as below then it should give error msg.
If there Record is created with only 1 Module (i.e. Aa) then it will allow to create another one with module Bb.
E.g.,
1st Record
Catalog Form Variable:
- Group = ABC
- Module = Aa
Record created on a table with below field:
- Module = Post1
2nd Record
Catalog Form Variable:
- Group = ABC
- Module = Bb
Record created on a table with below field:
- Module = Post2

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2023 03:20 AM
@Rakshanda Kunte You need to create a Before insert/update business rule on Demo table and check the following.
var glideDemo = new GlideRecord('u_demo');//replace table name here with the name of your Demo table
glideDemo.addQuery('u_group',current.u_group); //replace with name of your group field on demo table
glideDemo.addQuery('u_group',current.u_module); //replace with name of your module field on demo table
glideDemo.query();
if(glideDemo.hasNext()){
gs.addErrorMessage('Module with name '+ u_module+ ' and group '+u_module+' already exist');
current.setAbortAction(true); //This prevents records from getting saved into database.
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2023 03:48 AM
Thanks @Sandeep RajputRajput for help!
I have tried creating business Rule, but it is not working.
I need to check 2 fields on Catalog Form i.e. Group and Modules then it will check in Tables if that entry exists or not.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2023 04:38 AM
@Rakshanda Kunte Please post your business rule snapshots and script here, I may be able to share more inputs once I see them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2023 05:26 AM
Hi @Sandeep Rajput ,
Below is the code.
Validation Applied on : Once 'Aa' is selected on a catalog form, it will map to Module field on a table with "Post 1" value.
if "Bb" selected on catalog form, it will map "Post 2" value on table. (This is done using flow designer)