# app.record.detail.process.proceed event fires multiple times after advancing Process Management Status

**URL:** <https://forum.kintone.dev/t/app-record-detail-process-proceed-event-fires-multiple-times-after-advancing-process-management-status/154>\
**Category:** General\
**Created:** [July 3, 2018, 2:26am UTC](https://forum.kintone.dev/t/app-record-detail-process-proceed-event-fires-multiple-times-after-advancing-process-management-status/154 "2018-07-03T02:26:01Z")\
**Posts on this page:** 4\
**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:** [July 3, 2018, 2:26am UTC](https://forum.kintone.dev/t/app-record-detail-process-proceed-event-fires-multiple-times-after-advancing-process-management-status/154/1 "2018-07-03T02:26:01Z")

</div>

Hello, I don’t believe this event should be firing multiple times for one click. This video shows the basic problem:&nbsp;[https://goo.gl/mNUyQf](https://goo.gl/mNUyQf)

This video explains my ultimate goal:&nbsp;[https://goo.gl/WoDC18](https://goo.gl/WoDC18)

This is my code:

```
// Process Management Alert messages
kintone.events.on("app.record.detail.process.proceed", function (event) {
//Get value of current status (before proceeding)
console.log(event);
var action = event.action.value;

if (action === "Paperwork Complete") {
//Display Sweet Alert message
return swal({
title: "Are you sure?",
text: "Please ensure all Resident Paperwork has been received before proceeding.",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, comfirmed"
}).then(function (result) {
if (result.value) return event;
else return false;
});
}

// Do nothing for other actions/statuses
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:** [July 4, 2018, 8:47pm UTC](https://forum.kintone.dev/t/app-record-detail-process-proceed-event-fires-multiple-times-after-advancing-process-management-status/154/2 "2018-07-04T20:47:44Z")

</div>

I have tried your coding but I was unable to get the same issue you had like the event firing multiple time. But as your video shows, the same log is input at console multiple times, so the event&nbsp;have&nbsp;incurred more than once.

Regarding the error message on the console, I was able to get the error about “then” that cannot be used. Probably, to change the process to return swal, there might be some additional process besides the one you mentioned here.

Could I ask&nbsp; two&nbsp;additional info?

1. The setting for Process Management

2. The whole code

&nbsp;

---

<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:** [July 5, 2018, 1:55am UTC](https://forum.kintone.dev/t/app-record-detail-process-proceed-event-fires-multiple-times-after-advancing-process-management-status/154/3 "2018-07-05T01:55:25Z")

</div>

Junko, after just now having a fresh look at my code, I see that my function for&nbsp;app.record.detail.process.proceed was accidentally inside of my&nbsp;app.record.detail.show function, which explains the additional fires. My script is about 100 lines and I hadn’t noticed before. Time to tidy things us by separating everything into outer scope functions and call from within the Kintone events. Everything is working exactly as expected now. Sorry to have wasted your time.

---

<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:** [July 5, 2018, 8:46pm UTC](https://forum.kintone.dev/t/app-record-detail-process-proceed-event-fires-multiple-times-after-advancing-process-management-status/154/4 "2018-07-05T20:46:51Z")

</div>

No worries! I am glad that you found another event was causing the problem previously and everything worked out now.
