Need a pop up alert when we create a account with same or simillar name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 10:18 PM
Hi All,
I have requirement that we have an accounts, when the Accounts team wants to create new account , then on the new form if they enter name which already created and trying to save form then there alert or validation should be there , this name already exist
Please help me sort out this
Thanks
Ram

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 10:25 PM
Hi Ram,
You can simply create a before insert BR on the Account table and allow/abort action accordingly. Kindly share what is that is you have tried and what you are stuck with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 10:42 PM
Thanks for the response
I didn't start anything , so can you please provide me the code for that
Thanks
Ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 10:34 PM
Hi @Ramu6
Require unique values for a field
The system allows you to require that a field's values be unique. When this is done, the system will not let two records have the same value for that field.
By default, fields are created without this constraint. A field can have unique values only if there aren't already duplicate values in the database for that field. The system doesn't allow you to make a field unique while there are duplicate values in the table.
The system also doesn't allow you to add a unique index if a non-unique index already exists. In this scenario, you can't select the Unique check box on the form; instead, the system directs you to the Tables & Columns module, so you can drop the non-unique index, and then create the unique index.
Procedure
- Verify that no records in the table for the field have values, or that they all have the same value.
- Right-click the field label in the form and select Configure Dictionary.
- Configure the form to add the Unique field if it does not already appear.
- Select the Unique check box.
- Update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 10:35 PM
Hi @Ramu6 ,
You can create a before insert business rule which checks if the user name already exisit before record insertion...
When to run :
Before Insert > with no filter condition.
Script :
var cr_name = new GlideRecord('sys_user');
cr_name.addQuery('name', current.name);
cr_name.query(); // you can also use cr_name.getRowCount() to see if its more than 1
if(cr_name.next()){
current.setabortAction(true);
//add error message if needed...
}
I hope this helps...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....