# app.record.create.show時のキャンセル処理

**URL:** https://community.cybozu.dev/t/topic/3009
**Category:** kintone 開発相談
**Created:** [2018 年 4 月 20 日午前 7:49 UTC](https://community.cybozu.dev/t/topic/3009 "2018-04-20T07:49:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Legacy\_Account333](https://avatars.discourse-cdn.com/v4/letter/l/6bbea6/32.png) [@Legacy\_Account333](https://community.cybozu.dev/u/Legacy_Account333)
#### Post date: [2018 年 4 月 20 日午前 7:49 UTC](https://community.cybozu.dev/t/topic/3009/1 "2018-04-20T07:49:30Z")

</div>

GaroonスケジュールからKintoneへのデータ登録するアプリを作成しています。

そのためKintone側で新規作成を行った場合に警告を出しキャンセルを行いたいのですが、app.record.create.showイベントを取得した後に、アラートを表示しそのままreturn eventで抜けるようにしているのですが、編集状態のまま一覧画面まで戻りません。

初歩的な質問で申し訳ないですが、ご教授願います。

kintone.events.on(“app.record.create.show”, function(event) {  
//警告アラート  
return event;  
});

---

<div class="post-metadata">

### Author: ![Legacy\_Account1517](https://avatars.discourse-cdn.com/v4/letter/l/4bbf92/32.png) [@Legacy\_Account1517](https://community.cybozu.dev/u/Legacy_Account1517)
#### Post date: [2018 年 4 月 21 日午前 5:15 UTC](https://community.cybozu.dev/t/topic/3009/2 "2018-04-21T05:15:02Z")

</div>

Kintone初心者研修中さん

新規登録画面は、詳細画面からでも遷移できますので、前の画面に戻せばいいと思います。

ただし、そのまま return event; すると、レコード登録されますので、error を設定します。

&nbsp;

```
kintone.events.on("app.record.create.show", function(event) {
//警告アラート
event.error = '警告アラート'
window.history.back();
return event;
});

```
