# How to stop Kintone from saving duplicate records in the Create Record page?

**URL:** <https://forum.kintone.dev/t/how-to-stop-kintone-from-saving-duplicate-records-in-the-create-record-page/233>\
**Category:** General\
**Tags:** prevent-duplicate\
**Created:** [January 7, 2022, 9:29pm UTC](https://forum.kintone.dev/t/how-to-stop-kintone-from-saving-duplicate-records-in-the-create-record-page/233 "2022-01-07T21:29:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [January 7, 2022, 9:29pm UTC](https://forum.kintone.dev/t/how-to-stop-kintone-from-saving-duplicate-records-in-the-create-record-page/233/1 "2022-01-07T21:29:07Z")

</div>

I want to prevent users from saving duplicate company records in the database.

So in the **`app.record.create.submit`** event handler, I call `checkDuplicate(record)` to check to see if the company record already exists.  
The `checkDuplicate(record)` is a function that calls a `kintone.proxy()`.

The `kintone.proxy()` is an asynchronous operation.

The problem is the event handler **`app.record.create.submit`** finishes before `kintone.proxy()` finishes, and the duplicate record is saved.

**How to stop the user from saving a duplicate company record?**

This event is triggered when the SAVE button is clicked on the record create page.

```javascript
kintone.events.on("app.record.create.submit", function (event) {
  var record = event.record;
  checkDuplicate(record);
  return event;
});

```

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [January 11, 2022, 10:35pm UTC](https://forum.kintone.dev/t/how-to-stop-kintone-from-saving-duplicate-records-in-the-create-record-page/233/2 "2022-01-11T22:35:21Z")

</div>

Before we look deeper into this, …

Perhaps the [Prohibit Duplicate Values setting](https://forum.kintone.dev/t/prevent-users-from-entering-duplicate-values-with-prohibit-duplicate-values-fields-settings/625), a native feature available in many fields, might meet your needs.
